DataType
abstract class DataType<T : Any, D : DataPoint<T>>
AggregateDataType |
|
DeltaDataType |
|
A data type is a representation of health data managed by Health Services.
A DataType specifies the type of the values inside of a DataPoint. Health Services defines data types for instantaneous observations (Samples / SampleDataPoint, e.g. heart rate) and data types for a change between readings (Intervals / IntervalDataPoint, e.g. distance).
Health services also allows specifying aggregated versions of many data types, which will allow the developer to get e.g. a running total of intervals (CumulativeDataPoint) or statistics like min/max/average on samples (StatisticalDataPoint).
Note: the data type defines only the representation and format of the data, and not how it's being collected, the sensor being used, or the parameters of the collection. As an example, DISTANCE may come from GPS location if available, or steps if not available.
Summary
Nested types |
|---|
class DataType.TimeTypeWhether the |
Public companion properties |
|
|---|---|
DeltaDataType<Double, SampleDataPoint<Double>> |
Absolute elevation at a specific point in time expressed in meters. |
AggregateDataType<Double, StatisticalDataPoint<Double>> |
Statistical information about the absolute elevation over the course of the active exercise expressed in meters. |
AggregateDataType<Long, CumulativeDataPoint<Long>> |
The total time the Exercise was |
DeltaDataType<Double, IntervalDataPoint<Double>> |
Number of calories burned (including basal rate and activity) since the last update. |
DeltaDataType<Double, IntervalDataPoint<Double>> |
The total number of calories over a day (including both BMR and active calories), where the previous day ends and a new day begins at 12:00 AM local time. |
AggregateDataType<Double, CumulativeDataPoint<Double>> |
Total number of calories burned (including basal rate and activity) since the start of the current active exercise. |
DeltaDataType<Double, IntervalDataPoint<Double>> |
Distance traveled over declining ground between each reading expressed in meters. |
AggregateDataType<Double, CumulativeDataPoint<Double>> |
The total distance traveled over declining ground between each reading since the start of the active exercise expressed in meters. |
DeltaDataType<Long, IntervalDataPoint<Long>> |
The amount of time the user spent traveling over declining ground since the last update, expressed in seconds. |
AggregateDataType<Long, CumulativeDataPoint<Long>> |
Total duration the user spent traveling over declining ground since the start of the active exercise, expressed in seconds. |
DeltaDataType<Double, IntervalDataPoint<Double>> |
A distance delta between each reading expressed in meters. |
DeltaDataType<Double, IntervalDataPoint<Double>> |
The total distance over a day, where the previous day ends and a new day begins at 12:00 AM local time. |
AggregateDataType<Double, CumulativeDataPoint<Double>> |
Total distance since the start of the active exercise expressed in meters. |
DeltaDataType<Double, IntervalDataPoint<Double>> |
A measure of the gain in elevation since the last update expressed in meters. |
DeltaDataType<Double, IntervalDataPoint<Double>> |
The total gain in elevation over a day expressed in meters in |
AggregateDataType<Double, CumulativeDataPoint<Double>> |
A measure of the total gain in elevation since the start of an active exercise expressed in meters. |
DeltaDataType<Double, IntervalDataPoint<Double>> |
A measure of the loss in elevation since the last update expressed in meters. |
AggregateDataType<Double, CumulativeDataPoint<Double>> |
A measure of the total loss in elevation since the start of an active exercise expressed in meters. |
DeltaDataType<Double, IntervalDataPoint<Double>> |
The distance traveled over flat since the last update expressed in meters. |
AggregateDataType<Double, CumulativeDataPoint<Double>> |
The total distance traveled over flat ground since the start of the active exercise expressed in meters. |
DeltaDataType<Long, IntervalDataPoint<Long>> |
The amount of time the user spent traveling over flat ground since the last update, expressed in seconds. |
AggregateDataType<Long, CumulativeDataPoint<Long>> |
The total duration the user spent traveling over flat ground since the start of the active exercise, expressed in seconds. |
DeltaDataType<Double, IntervalDataPoint<Double>> |
Number of floors climbed since the last update. |
DeltaDataType<Double, IntervalDataPoint<Double>> |
The total number floors climbed over a day, where the previous day ends and a new day begins at 12:00 AM local time. |
AggregateDataType<Double, CumulativeDataPoint<Double>> |
Total number of floors climbed since the start of the active exercise. |
DeltaDataType<Long, IntervalDataPoint<Long>> |
The number of golf shots taken since the last update, where a golf shot consists of swinging the club and hitting the ball. |
AggregateDataType<Long, CumulativeDataPoint<Long>> |
The total number of golf shots taken since the start of the current active exercise, where a golf shot consists swinging the club and hitting the ball. |
DeltaDataType<Long, SampleDataPoint<Long>> |
The amount of time during a single step that the runner's foot was in contact with the ground in milliseconds in |
AggregateDataType<Long, StatisticalDataPoint<Long>> |
Statistics on the amount of time during a single step that the runner's foot was in contact with the ground in milliseconds in |
DeltaDataType<Double, SampleDataPoint<Double>> |
Current heart rate, in beats per minute. |
AggregateDataType<Double, StatisticalDataPoint<Double>> |
Statistics on heart rate since the start of the current exercise, expressed in beats per minute. |
DeltaDataType<Double, IntervalDataPoint<Double>> |
The distance traveled over inclining ground since the last update expressed in meters. |
AggregateDataType<Double, CumulativeDataPoint<Double>> |
The total distance traveled over inclining since the start of the active exercise expressed in meters. |
DeltaDataType<Long, IntervalDataPoint<Long>> |
The amount of time the user spent traveling over inclining ground since the last update, expressed in seconds. |
AggregateDataType<Long, CumulativeDataPoint<Long>> |
Total amount of time the user spent traveling over inclining ground since the start of the active exercise, expressed in seconds. |
DeltaDataType<LocationData, SampleDataPoint<LocationData>> |
Latitude, longitude and optionally, altitude and bearing at a specific point in time. |
DeltaDataType<Double, SampleDataPoint<Double>> |
Pace at a specific point in time. |
AggregateDataType<Double, StatisticalDataPoint<Double>> |
Statistics on pace since the start of the current exercise. |
DeltaDataType<Long, IntervalDataPoint<Long>> |
The number of repetitions of an exercise performed since the last update. |
AggregateDataType<Long, CumulativeDataPoint<Long>> |
The number of repetitions of an exercise performed since the start of the current active exercise. |
DeltaDataType<Long, IntervalDataPoint<Long>> |
The number of seconds the user has been resting during an exercise since the last update. |
AggregateDataType<Long, CumulativeDataPoint<Long>> |
The total number of seconds the user has been resting during the active exercise. |
DeltaDataType<Long, IntervalDataPoint<Long>> |
Number of steps taken while running since the last update. |
AggregateDataType<Long, CumulativeDataPoint<Long>> |
Number of steps taken while running since the start of the current active exercise. |
DeltaDataType<Double, SampleDataPoint<Double>> |
Speed at a specific point in time, expressed as meters/second. |
AggregateDataType<Double, StatisticalDataPoint<Double>> |
Statistics on speed since the start of the active exercise, expressed in meters/second. |
DeltaDataType<Long, IntervalDataPoint<Long>> |
Number of steps taken since the last update. |
DeltaDataType<Long, IntervalDataPoint<Long>> |
The total step count over a day, where the previous day ends and a new day begins at 12:00 AM local time. |
DeltaDataType<Long, SampleDataPoint<Long>> |
Step rate in steps/minute at a given point in time. |
AggregateDataType<Long, StatisticalDataPoint<Long>> |
Statistics on step rate in steps/minute since the beginning of the current active exercise. |
AggregateDataType<Long, CumulativeDataPoint<Long>> |
Total steps taken since the start of the active exercise. |
DeltaDataType<Double, SampleDataPoint<Double>> |
Distance covered by a single step in meters in |
AggregateDataType<Double, StatisticalDataPoint<Double>> |
Statistics on distance covered by a single step in meters in |
DeltaDataType<Long, IntervalDataPoint<Long>> |
Count of swimming laps since the last update. |
AggregateDataType<Long, CumulativeDataPoint<Long>> |
Count of swimming laps since the start of the current active exercise. |
DeltaDataType<Long, IntervalDataPoint<Long>> |
Number of swimming strokes taken since the last update. |
AggregateDataType<Long, CumulativeDataPoint<Long>> |
Total number of swimming strokes taken since the start of the current active exercise. |
DeltaDataType<Double, SampleDataPoint<Double>> |
Distance the center of mass moves up-and-down with each step in centimeters in |
AggregateDataType<Double, StatisticalDataPoint<Double>> |
Statistic on distance the center of mass moves up-and-down with each step in centimeters in |
DeltaDataType<Double, SampleDataPoint<Double>> |
Vertical oscillation / stride length. |
AggregateDataType<Double, StatisticalDataPoint<Double>> |
Statistics on vertical oscillation / stride length. |
DeltaDataType<Double, SampleDataPoint<Double>> |
Maximum rate of oxygen consumption measured at a specific point in time. |
AggregateDataType<Double, StatisticalDataPoint<Double>> |
Statistics on maximum rate of oxygen consumption measured since the start of an exercise. |
DeltaDataType<Long, IntervalDataPoint<Long>> |
Number of steps taken while walking since the last update. |
AggregateDataType<Long, CumulativeDataPoint<Long>> |
Total number of steps taken while walking since the start of the current active exercise. |
Public constructors |
|---|
Public companion properties
ABSOLUTE_ELEVATION
val ABSOLUTE_ELEVATION: DeltaDataType<Double, SampleDataPoint<Double>>
Absolute elevation at a specific point in time expressed in meters.
ABSOLUTE_ELEVATION_STATS
val ABSOLUTE_ELEVATION_STATS: AggregateDataType<Double, StatisticalDataPoint<Double>>
Statistical information about the absolute elevation over the course of the active exercise expressed in meters.
ACTIVE_EXERCISE_DURATION_TOTAL
val ACTIVE_EXERCISE_DURATION_TOTAL: AggregateDataType<Long, CumulativeDataPoint<Long>>
The total time the Exercise was ExerciseState.ACTIVE in seconds.
Note: this DataType is only intended to be used in conjunction with exercise goals. DataPoints will not be delivered for this DataType. If you want to query the active duration, you should use ExerciseUpdate.activeDuration which is available in every ExerciseUpdate.
CALORIES
val CALORIES: DeltaDataType<Double, IntervalDataPoint<Double>>
Number of calories burned (including basal rate and activity) since the last update.
CALORIES_DAILY
val CALORIES_DAILY: DeltaDataType<Double, IntervalDataPoint<Double>>
The total number of calories over a day (including both BMR and active calories), where the previous day ends and a new day begins at 12:00 AM local time. Each DataPoint of this type will cover the interval from the start of day to now. In the event of time-zone shifts, the interval might be greater than 24hrs.
CALORIES_TOTAL
val CALORIES_TOTAL: AggregateDataType<Double, CumulativeDataPoint<Double>>
Total number of calories burned (including basal rate and activity) since the start of the current active exercise.
DECLINE_DISTANCE
val DECLINE_DISTANCE: DeltaDataType<Double, IntervalDataPoint<Double>>
Distance traveled over declining ground between each reading expressed in meters.
DECLINE_DISTANCE_TOTAL
val DECLINE_DISTANCE_TOTAL: AggregateDataType<Double, CumulativeDataPoint<Double>>
The total distance traveled over declining ground between each reading since the start of the active exercise expressed in meters.
DECLINE_DURATION
val DECLINE_DURATION: DeltaDataType<Long, IntervalDataPoint<Long>>
The amount of time the user spent traveling over declining ground since the last update, expressed in seconds.
DECLINE_DURATION_TOTAL
val DECLINE_DURATION_TOTAL: AggregateDataType<Long, CumulativeDataPoint<Long>>
Total duration the user spent traveling over declining ground since the start of the active exercise, expressed in seconds.
DISTANCE
val DISTANCE: DeltaDataType<Double, IntervalDataPoint<Double>>
A distance delta between each reading expressed in meters.
DISTANCE_DAILY
val DISTANCE_DAILY: DeltaDataType<Double, IntervalDataPoint<Double>>
The total distance over a day, where the previous day ends and a new day begins at 12:00 AM local time. Each DataPoint of this type will cover the interval from the start of day to now. In the event of time-zone shifts, the interval may be greater than 24hrs.
DISTANCE_TOTAL
val DISTANCE_TOTAL: AggregateDataType<Double, CumulativeDataPoint<Double>>
Total distance since the start of the active exercise expressed in meters.
ELEVATION_GAIN
val ELEVATION_GAIN: DeltaDataType<Double, IntervalDataPoint<Double>>
A measure of the gain in elevation since the last update expressed in meters. Elevation losses are not counted in this metric (so it will only be positive or 0).
ELEVATION_GAIN_DAILY
val ELEVATION_GAIN_DAILY: DeltaDataType<Double, IntervalDataPoint<Double>>
The total gain in elevation over a day expressed in meters in double format, where the previous day ends and a new day begins at 12:00 AM local time. Elevation losses are not counted in this metric (so it will only be positive or 0). Each DataPoint of this type will cover the interval from the start of day to now. In the event of time-zone shifts, the interval might be greater than 24hrs.
ELEVATION_GAIN_TOTAL
val ELEVATION_GAIN_TOTAL: AggregateDataType<Double, CumulativeDataPoint<Double>>
A measure of the total gain in elevation since the start of an active exercise expressed in meters. Elevation losses are not counted in this metric (so it will only be positive or 0).
ELEVATION_LOSS
val ELEVATION_LOSS: DeltaDataType<Double, IntervalDataPoint<Double>>
A measure of the loss in elevation since the last update expressed in meters. Elevation gains are not counted in this metric (so it will only be positive or 0).
ELEVATION_LOSS_TOTAL
val ELEVATION_LOSS_TOTAL: AggregateDataType<Double, CumulativeDataPoint<Double>>
A measure of the total loss in elevation since the start of an active exercise expressed in meters. Elevation gains are not counted in this metric (so it will only be positive or 0).
FLAT_GROUND_DISTANCE
val FLAT_GROUND_DISTANCE: DeltaDataType<Double, IntervalDataPoint<Double>>
The distance traveled over flat since the last update expressed in meters.
FLAT_GROUND_DISTANCE_TOTAL
val FLAT_GROUND_DISTANCE_TOTAL: AggregateDataType<Double, CumulativeDataPoint<Double>>
The total distance traveled over flat ground since the start of the active exercise expressed in meters.
FLAT_GROUND_DURATION
val FLAT_GROUND_DURATION: DeltaDataType<Long, IntervalDataPoint<Long>>
The amount of time the user spent traveling over flat ground since the last update, expressed in seconds.
FLAT_GROUND_DURATION_TOTAL
val FLAT_GROUND_DURATION_TOTAL: AggregateDataType<Long, CumulativeDataPoint<Long>>
The total duration the user spent traveling over flat ground since the start of the active exercise, expressed in seconds.
FLOORS
val FLOORS: DeltaDataType<Double, IntervalDataPoint<Double>>
Number of floors climbed since the last update. Note that partial floors are supported, so this is represented as a Double.
FLOORS_DAILY
val FLOORS_DAILY: DeltaDataType<Double, IntervalDataPoint<Double>>
The total number floors climbed over a day, where the previous day ends and a new day begins at 12:00 AM local time. Each DataPoint of this type will cover the interval from the start of day to now. In the event of time-zone shifts, the interval may be greater than 24hrs.
FLOORS_TOTAL
val FLOORS_TOTAL: AggregateDataType<Double, CumulativeDataPoint<Double>>
Total number of floors climbed since the start of the active exercise. Note that partial floors are supported, so this is represented as a Double.
GOLF_SHOT_COUNT
val GOLF_SHOT_COUNT: DeltaDataType<Long, IntervalDataPoint<Long>>
The number of golf shots taken since the last update, where a golf shot consists of swinging the club and hitting the ball.
GOLF_SHOT_COUNT_TOTAL
val GOLF_SHOT_COUNT_TOTAL: AggregateDataType<Long, CumulativeDataPoint<Long>>
The total number of golf shots taken since the start of the current active exercise, where a golf shot consists swinging the club and hitting the ball.
GROUND_CONTACT_TIME
val GROUND_CONTACT_TIME: DeltaDataType<Long, SampleDataPoint<Long>>
The amount of time during a single step that the runner's foot was in contact with the ground in milliseconds in long format.
GROUND_CONTACT_TIME_STATS
val GROUND_CONTACT_TIME_STATS: AggregateDataType<Long, StatisticalDataPoint<Long>>
Statistics on the amount of time during a single step that the runner's foot was in contact with the ground in milliseconds in long format.
HEART_RATE_BPM
val HEART_RATE_BPM: DeltaDataType<Double, SampleDataPoint<Double>>
Current heart rate, in beats per minute.
Accuracy for a DataPoint of type DataType.HEART_RATE_BPM is represented by HeartRateAccuracy.
HEART_RATE_BPM_STATS
val HEART_RATE_BPM_STATS: AggregateDataType<Double, StatisticalDataPoint<Double>>
Statistics on heart rate since the start of the current exercise, expressed in beats per minute.
INCLINE_DISTANCE
val INCLINE_DISTANCE: DeltaDataType<Double, IntervalDataPoint<Double>>
The distance traveled over inclining ground since the last update expressed in meters.
INCLINE_DISTANCE_TOTAL
val INCLINE_DISTANCE_TOTAL: AggregateDataType<Double, CumulativeDataPoint<Double>>
The total distance traveled over inclining since the start of the active exercise expressed in meters.
INCLINE_DURATION
val INCLINE_DURATION: DeltaDataType<Long, IntervalDataPoint<Long>>
The amount of time the user spent traveling over inclining ground since the last update, expressed in seconds.
INCLINE_DURATION_TOTAL
val INCLINE_DURATION_TOTAL: AggregateDataType<Long, CumulativeDataPoint<Long>>
Total amount of time the user spent traveling over inclining ground since the start of the active exercise, expressed in seconds.
LOCATION
val LOCATION: DeltaDataType<LocationData, SampleDataPoint<LocationData>>
Latitude, longitude and optionally, altitude and bearing at a specific point in time.
Accuracy for a DataPoint of type LOCATION is represented by LocationAccuracy.
PACE
val PACE: DeltaDataType<Double, SampleDataPoint<Double>>
Pace at a specific point in time. Will be 0 if the user stops moving, otherwise the value will be in milliseconds/kilometer.
PACE_STATS
val PACE_STATS: AggregateDataType<Double, StatisticalDataPoint<Double>>
Statistics on pace since the start of the current exercise. A value of 0 indicates the user stopped moving, otherwise the value will be in milliseconds/kilometer.
REP_COUNT
val REP_COUNT: DeltaDataType<Long, IntervalDataPoint<Long>>
The number of repetitions of an exercise performed since the last update.
REP_COUNT_TOTAL
val REP_COUNT_TOTAL: AggregateDataType<Long, CumulativeDataPoint<Long>>
The number of repetitions of an exercise performed since the start of the current active exercise.
RESTING_EXERCISE_DURATION
val RESTING_EXERCISE_DURATION: DeltaDataType<Long, IntervalDataPoint<Long>>
The number of seconds the user has been resting during an exercise since the last update.
RESTING_EXERCISE_DURATION_TOTAL
val RESTING_EXERCISE_DURATION_TOTAL: AggregateDataType<Long, CumulativeDataPoint<Long>>
The total number of seconds the user has been resting during the active exercise.
RUNNING_STEPS
val RUNNING_STEPS: DeltaDataType<Long, IntervalDataPoint<Long>>
Number of steps taken while running since the last update.
RUNNING_STEPS_TOTAL
val RUNNING_STEPS_TOTAL: AggregateDataType<Long, CumulativeDataPoint<Long>>
Number of steps taken while running since the start of the current active exercise.
SPEED
val SPEED: DeltaDataType<Double, SampleDataPoint<Double>>
Speed at a specific point in time, expressed as meters/second.
SPEED_STATS
val SPEED_STATS: AggregateDataType<Double, StatisticalDataPoint<Double>>
Statistics on speed since the start of the active exercise, expressed in meters/second.
STEPS
val STEPS: DeltaDataType<Long, IntervalDataPoint<Long>>
Number of steps taken since the last update.
STEPS_DAILY
val STEPS_DAILY: DeltaDataType<Long, IntervalDataPoint<Long>>
The total step count over a day, where the previous day ends and a new day begins at 12:00 AM local time. Each DataPoint of this type will cover the interval from the start of day to now. In the event of time-zone shifts, the interval may be greater than 24hrs.
STEPS_PER_MINUTE
val STEPS_PER_MINUTE: DeltaDataType<Long, SampleDataPoint<Long>>
Step rate in steps/minute at a given point in time.
STEPS_PER_MINUTE_STATS
val STEPS_PER_MINUTE_STATS: AggregateDataType<Long, StatisticalDataPoint<Long>>
Statistics on step rate in steps/minute since the beginning of the current active exercise.
STEPS_TOTAL
val STEPS_TOTAL: AggregateDataType<Long, CumulativeDataPoint<Long>>
Total steps taken since the start of the active exercise.
STRIDE_LENGTH
val STRIDE_LENGTH: DeltaDataType<Double, SampleDataPoint<Double>>
Distance covered by a single step in meters in double format.
STRIDE_LENGTH_STATS
val STRIDE_LENGTH_STATS: AggregateDataType<Double, StatisticalDataPoint<Double>>
Statistics on distance covered by a single step in meters in double format.
SWIMMING_LAP_COUNT
val SWIMMING_LAP_COUNT: DeltaDataType<Long, IntervalDataPoint<Long>>
Count of swimming laps since the last update.
SWIMMING_LAP_COUNT_TOTAL
val SWIMMING_LAP_COUNT_TOTAL: AggregateDataType<Long, CumulativeDataPoint<Long>>
Count of swimming laps since the start of the current active exercise.
SWIMMING_STROKES
val SWIMMING_STROKES: DeltaDataType<Long, IntervalDataPoint<Long>>
Number of swimming strokes taken since the last update.
SWIMMING_STROKES_TOTAL
val SWIMMING_STROKES_TOTAL: AggregateDataType<Long, CumulativeDataPoint<Long>>
Total number of swimming strokes taken since the start of the current active exercise.
VERTICAL_OSCILLATION
val VERTICAL_OSCILLATION: DeltaDataType<Double, SampleDataPoint<Double>>
Distance the center of mass moves up-and-down with each step in centimeters in double format.
VERTICAL_OSCILLATION_STATS
val VERTICAL_OSCILLATION_STATS: AggregateDataType<Double, StatisticalDataPoint<Double>>
Statistic on distance the center of mass moves up-and-down with each step in centimeters in double format.
VERTICAL_RATIO
val VERTICAL_RATIO: DeltaDataType<Double, SampleDataPoint<Double>>
Vertical oscillation / stride length.
For example, a vertical oscillation of 5.0cm and stride length .8m (80 cm) would have a vertical ratio of 0.625.
VERTICAL_RATIO_STATS
val VERTICAL_RATIO_STATS: AggregateDataType<Double, StatisticalDataPoint<Double>>
Statistics on vertical oscillation / stride length.
For example, a vertical oscillation of 5.0cm and stride length .8m (80 cm) would have a vertical ratio of 0.625.
VO2_MAX
val VO2_MAX: DeltaDataType<Double, SampleDataPoint<Double>>
Maximum rate of oxygen consumption measured at a specific point in time. Valid range 0f - 100f.
VO2_MAX_STATS
val VO2_MAX_STATS: AggregateDataType<Double, StatisticalDataPoint<Double>>
Statistics on maximum rate of oxygen consumption measured since the start of an exercise. Valid range 0f - 100f.
WALKING_STEPS
val WALKING_STEPS: DeltaDataType<Long, IntervalDataPoint<Long>>
Number of steps taken while walking since the last update.
WALKING_STEPS_TOTAL
val WALKING_STEPS_TOTAL: AggregateDataType<Long, CumulativeDataPoint<Long>>
Total number of steps taken while walking since the start of the current active exercise.