Platform basics

The following section explains the platform basics and fitness data formats and terminologies used by the Google Fit platform.

Data sources

Data sources represent unique sources of sensor data. They can expose raw data coming from hardware sensors on local or companion devices, which is categorized as TYPE_RAW. Data sources also expose derived data, created by transforming or merging other data sources, which are categorized as TYPE_DERIVED. They hold the metadata regarding the source, such as which hardware device (device name) or application (package name) generated the data. Multiple data sources can exist for the same data type, for example for the heart rate data type, we can have a heart rate sensor in a watch and a heart rate sensor in a chest wrap that show as two different data sources for one data type.

Data types

A data type defines the representation and format of any fitness data. It consists of a name and an ordered list of fields, where each field represents a dimension. For example, a data type for location contains three fields (latitude, longitude, and accuracy), whereas a data type for weight contains only one field. Certain data types can have corresponding aggregated data types; AGGREGATE_STEP_COUNT_DELTA is the aggregate data type of TYPE_STEP_COUNT_DELTA. For certain use cases, aggregated data types are very useful; for example, in a step counter application, a user would only be interested in knowing the total number of steps taken per day and not in the details (time) of each step. There are three kinds of data type:

  • Public data types: These are the standard data types provided by the Google fit platform and can be used by every one.
  • Private custom data types: These are custom data types that are specific to one app. Only the app that defines the data type can use it. They can be created using the Config API.
  • Sharable data types: These are custom data types that are provided by third-party app developers and are approved by Google. Any app can read sharable data types, but only whitelisted apps, which are specified by a third-party developer, can write data of that sharable data type. For example, Nike and Adidas have made their sharable data types available for read only access. They can be read using the Config API.

Data point

A data point represents a single data point in a data type's stream from a particular data source. A data point holds a value for each field, a timestamp, and an optional start time. A single data point can have multiple fields and a single value for each field. A data point can hold an instantaneous measurement, reading, or inputted observation, as well as averages or aggregates over a time interval.

Data set

As the name suggests, this represents a set of data points of the same type from a particular data source covering a specific time interval. It is a grouping of data points based on a certain date or time range. We use datasets to insert data in, and read data from, the fitness store.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset