No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.idea
app
gradle/wrapper
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

starter-android

Author: Tian Hao

Introduction

The starter app has the ability to pull data from GoogleFit and store it locally.

Prerequisites

Setup

  • Clone/Download the repo
  • Follow instructions to setup your OAuth Client 2.0 ID
  • Run the app

Data

Realm

The database we are using for local storage is Realm: http://realm.io. You should check it out even if you are not using the starter apps!

Data Model

The data model only consists of two model classes: HealthData and HealthDataModel. Although this seems generic and simplistic, it allows us to store data from almost all data types.

HealthData

public class HealthData extends RealmObject {
    public String id; 
    public String source;
    public Date date;
    public String type;
    public String participantId;
    public String sessionId;
}

HealthData stores generic health information (e.g. date, type, source, etc). This object does not store the actual data values; this is persisted in HealthDataValue. HealthData is loosely linked with HealthDataValue through LinkingObjects.


HealthDataValue

public class HealthDataValue extends RealmObject {

    public HealthData healthObject;
    public String label;
    public float value;

    public HealthDataValue (){}
}

HealthDataValue stores specific health values and labels for those values. It's linked to a HealthData object.