The following section explains the platform basics and fitness data formats and terminologies used by the Google Fit platform.
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.
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:
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.