abstract class DataType<T : Any, D : DataPoint<T>>

Known direct subclasses
AggregateDataType

DataType that represents aggregated data.

DeltaDataType

DataType that represents a granular, non-aggregated point in time.


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

Whether the DataType corresponds to a measurement spanning an interval, or a sample at a single point in time.

Public companion properties

DeltaDataType<DoubleSampleDataPoint<Double>>

Absolute elevation at a specific point in time expressed in meters.

AggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistical information about the absolute elevation over the course of the active exercise expressed in meters.

AggregateDataType<LongCumulativeDataPoint<Long>>

The total time the Exercise was ExerciseState.ACTIVE in seconds.

DeltaDataType<DoubleIntervalDataPoint<Double>>

Number of calories burned (including basal rate and activity) since the last update.

DeltaDataType<DoubleIntervalDataPoint<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<DoubleCumulativeDataPoint<Double>>

Total number of calories burned (including basal rate and activity) since the start of the current active exercise.

DeltaDataType<DoubleIntervalDataPoint<Double>>

Distance traveled over declining ground between each reading expressed in meters.

AggregateDataType<DoubleCumulativeDataPoint<Double>>

The total distance traveled over declining ground between each reading since the start of the active exercise expressed in meters.

DeltaDataType<LongIntervalDataPoint<Long>>

The amount of time the user spent traveling over declining ground since the last update, expressed in seconds.

AggregateDataType<LongCumulativeDataPoint<Long>>

Total duration the user spent traveling over declining ground since the start of the active exercise, expressed in seconds.

DeltaDataType<DoubleIntervalDataPoint<Double>>

A distance delta between each reading expressed in meters.

DeltaDataType<DoubleIntervalDataPoint<Double>>

The total distance over a day, where the previous day ends and a new day begins at 12:00 AM local time.

AggregateDataType<DoubleCumulativeDataPoint<Double>>

Total distance since the start of the active exercise expressed in meters.

DeltaDataType<DoubleIntervalDataPoint<Double>>

A measure of the gain in elevation since the last update expressed in meters.

DeltaDataType<DoubleIntervalDataPoint<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.

AggregateDataType<DoubleCumulativeDataPoint<Double>>

A measure of the total gain in elevation since the start of an active exercise expressed in meters.

DeltaDataType<DoubleIntervalDataPoint<Double>>

A measure of the loss in elevation since the last update expressed in meters.

AggregateDataType<DoubleCumulativeDataPoint<Double>>

A measure of the total loss in elevation since the start of an active exercise expressed in meters.

DeltaDataType<DoubleIntervalDataPoint<Double>>

The distance traveled over flat since the last update expressed in meters.

AggregateDataType<DoubleCumulativeDataPoint<Double>>

The total distance traveled over flat ground since the start of the active exercise expressed in meters.

DeltaDataType<LongIntervalDataPoint<Long>>

The amount of time the user spent traveling over flat ground since the last update, expressed in seconds.

AggregateDataType<LongCumulativeDataPoint<Long>>

The total duration the user spent traveling over flat ground since the start of the active exercise, expressed in seconds.

DeltaDataType<DoubleIntervalDataPoint<Double>>

Number of floors climbed since the last update.

DeltaDataType<DoubleIntervalDataPoint<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<DoubleCumulativeDataPoint<Double>>

Total number of floors climbed since the start of the active exercise.

DeltaDataType<LongIntervalDataPoint<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<LongCumulativeDataPoint<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<LongSampleDataPoint<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.

AggregateDataType<LongStatisticalDataPoint<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.

DeltaDataType<DoubleSampleDataPoint<Double>>

Current heart rate, in beats per minute.

AggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistics on heart rate since the start of the current exercise, expressed in beats per minute.

DeltaDataType<DoubleIntervalDataPoint<Double>>

The distance traveled over inclining ground since the last update expressed in meters.

AggregateDataType<DoubleCumulativeDataPoint<Double>>

The total distance traveled over inclining since the start of the active exercise expressed in meters.

DeltaDataType<LongIntervalDataPoint<Long>>

The amount of time the user spent traveling over inclining ground since the last update, expressed in seconds.

AggregateDataType<LongCumulativeDataPoint<Long>>

Total amount of time the user spent traveling over inclining ground since the start of the active exercise, expressed in seconds.

DeltaDataType<LocationDataSampleDataPoint<LocationData>>

Latitude, longitude and optionally, altitude and bearing at a specific point in time.

DeltaDataType<DoubleSampleDataPoint<Double>>

Pace at a specific point in time.

AggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistics on pace since the start of the current exercise.

DeltaDataType<LongIntervalDataPoint<Long>>

The number of repetitions of an exercise performed since the last update.

AggregateDataType<LongCumulativeDataPoint<Long>>

The number of repetitions of an exercise performed since the start of the current active exercise.

DeltaDataType<LongIntervalDataPoint<Long>>

The number of seconds the user has been resting during an exercise since the last update.

AggregateDataType<LongCumulativeDataPoint<Long>>

The total number of seconds the user has been resting during the active exercise.

DeltaDataType<LongIntervalDataPoint<Long>>

Number of steps taken while running since the last update.

AggregateDataType<LongCumulativeDataPoint<Long>>

Number of steps taken while running since the start of the current active exercise.

DeltaDataType<DoubleSampleDataPoint<Double>>

Speed at a specific point in time, expressed as meters/second.

AggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistics on speed since the start of the active exercise, expressed in meters/second.

DeltaDataType<LongIntervalDataPoint<Long>>

Number of steps taken since the last update.

DeltaDataType<LongIntervalDataPoint<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<LongSampleDataPoint<Long>>

Step rate in steps/minute at a given point in time.

AggregateDataType<LongStatisticalDataPoint<Long>>

Statistics on step rate in steps/minute since the beginning of the current active exercise.

AggregateDataType<LongCumulativeDataPoint<Long>>

Total steps taken since the start of the active exercise.

DeltaDataType<DoubleSampleDataPoint<Double>>

Distance covered by a single step in meters in double format.

AggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistics on distance covered by a single step in meters in double format.

DeltaDataType<LongIntervalDataPoint<Long>>

Count of swimming laps since the last update.

AggregateDataType<LongCumulativeDataPoint<Long>>

Count of swimming laps since the start of the current active exercise.

DeltaDataType<LongIntervalDataPoint<Long>>

Number of swimming strokes taken since the last update.

AggregateDataType<LongCumulativeDataPoint<Long>>

Total number of swimming strokes taken since the start of the current active exercise.

DeltaDataType<DoubleSampleDataPoint<Double>>

Distance the center of mass moves up-and-down with each step in centimeters in double format.

AggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistic on distance the center of mass moves up-and-down with each step in centimeters in double format.

DeltaDataType<DoubleSampleDataPoint<Double>>

Vertical oscillation / stride length.

AggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistics on vertical oscillation / stride length.

DeltaDataType<DoubleSampleDataPoint<Double>>

Maximum rate of oxygen consumption measured at a specific point in time.

AggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistics on maximum rate of oxygen consumption measured since the start of an exercise.

DeltaDataType<LongIntervalDataPoint<Long>>

Number of steps taken while walking since the last update.

AggregateDataType<LongCumulativeDataPoint<Long>>

Total number of steps taken while walking since the start of the current active exercise.

Public constructors

<T : Any, D : DataPoint<T>> DataType(
    name: String,
    timeType: DataType.TimeType,
    valueClass: Class<T>,
    isAggregate: Boolean
)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

String

Returns the name of this DataType, e.g. "Steps".

Class<T>

Returns the underlying Class of this DataType.

Public companion properties

ABSOLUTE_ELEVATION

val ABSOLUTE_ELEVATIONDeltaDataType<DoubleSampleDataPoint<Double>>

Absolute elevation at a specific point in time expressed in meters.

ABSOLUTE_ELEVATION_STATS

val ABSOLUTE_ELEVATION_STATSAggregateDataType<DoubleStatisticalDataPoint<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_TOTALAggregateDataType<LongCumulativeDataPoint<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 CALORIESDeltaDataType<DoubleIntervalDataPoint<Double>>

Number of calories burned (including basal rate and activity) since the last update.

CALORIES_DAILY

val CALORIES_DAILYDeltaDataType<DoubleIntervalDataPoint<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_TOTALAggregateDataType<DoubleCumulativeDataPoint<Double>>

Total number of calories burned (including basal rate and activity) since the start of the current active exercise.

DECLINE_DISTANCE

val DECLINE_DISTANCEDeltaDataType<DoubleIntervalDataPoint<Double>>

Distance traveled over declining ground between each reading expressed in meters.

DECLINE_DISTANCE_TOTAL

val DECLINE_DISTANCE_TOTALAggregateDataType<DoubleCumulativeDataPoint<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_DURATIONDeltaDataType<LongIntervalDataPoint<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_TOTALAggregateDataType<LongCumulativeDataPoint<Long>>

Total duration the user spent traveling over declining ground since the start of the active exercise, expressed in seconds.

DISTANCE

val DISTANCEDeltaDataType<DoubleIntervalDataPoint<Double>>

A distance delta between each reading expressed in meters.

DISTANCE_DAILY

val DISTANCE_DAILYDeltaDataType<DoubleIntervalDataPoint<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_TOTALAggregateDataType<DoubleCumulativeDataPoint<Double>>

Total distance since the start of the active exercise expressed in meters.

ELEVATION_GAIN

val ELEVATION_GAINDeltaDataType<DoubleIntervalDataPoint<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_DAILYDeltaDataType<DoubleIntervalDataPoint<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_TOTALAggregateDataType<DoubleCumulativeDataPoint<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_LOSSDeltaDataType<DoubleIntervalDataPoint<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_TOTALAggregateDataType<DoubleCumulativeDataPoint<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_DISTANCEDeltaDataType<DoubleIntervalDataPoint<Double>>

The distance traveled over flat since the last update expressed in meters.

FLAT_GROUND_DISTANCE_TOTAL

val FLAT_GROUND_DISTANCE_TOTALAggregateDataType<DoubleCumulativeDataPoint<Double>>

The total distance traveled over flat ground since the start of the active exercise expressed in meters.

FLAT_GROUND_DURATION

val FLAT_GROUND_DURATIONDeltaDataType<LongIntervalDataPoint<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_TOTALAggregateDataType<LongCumulativeDataPoint<Long>>

The total duration the user spent traveling over flat ground since the start of the active exercise, expressed in seconds.

FLOORS

val FLOORSDeltaDataType<DoubleIntervalDataPoint<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_DAILYDeltaDataType<DoubleIntervalDataPoint<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_TOTALAggregateDataType<DoubleCumulativeDataPoint<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_COUNTDeltaDataType<LongIntervalDataPoint<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_TOTALAggregateDataType<LongCumulativeDataPoint<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_TIMEDeltaDataType<LongSampleDataPoint<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_STATSAggregateDataType<LongStatisticalDataPoint<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_BPMDeltaDataType<DoubleSampleDataPoint<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_STATSAggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistics on heart rate since the start of the current exercise, expressed in beats per minute.

INCLINE_DISTANCE

val INCLINE_DISTANCEDeltaDataType<DoubleIntervalDataPoint<Double>>

The distance traveled over inclining ground since the last update expressed in meters.

INCLINE_DISTANCE_TOTAL

val INCLINE_DISTANCE_TOTALAggregateDataType<DoubleCumulativeDataPoint<Double>>

The total distance traveled over inclining since the start of the active exercise expressed in meters.

INCLINE_DURATION

val INCLINE_DURATIONDeltaDataType<LongIntervalDataPoint<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_TOTALAggregateDataType<LongCumulativeDataPoint<Long>>

Total amount of time the user spent traveling over inclining ground since the start of the active exercise, expressed in seconds.

LOCATION

val LOCATIONDeltaDataType<LocationDataSampleDataPoint<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 PACEDeltaDataType<DoubleSampleDataPoint<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_STATSAggregateDataType<DoubleStatisticalDataPoint<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_COUNTDeltaDataType<LongIntervalDataPoint<Long>>

The number of repetitions of an exercise performed since the last update.

REP_COUNT_TOTAL

val REP_COUNT_TOTALAggregateDataType<LongCumulativeDataPoint<Long>>

The number of repetitions of an exercise performed since the start of the current active exercise.

RESTING_EXERCISE_DURATION

val RESTING_EXERCISE_DURATIONDeltaDataType<LongIntervalDataPoint<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_TOTALAggregateDataType<LongCumulativeDataPoint<Long>>

The total number of seconds the user has been resting during the active exercise.

RUNNING_STEPS

val RUNNING_STEPSDeltaDataType<LongIntervalDataPoint<Long>>

Number of steps taken while running since the last update.

RUNNING_STEPS_TOTAL

val RUNNING_STEPS_TOTALAggregateDataType<LongCumulativeDataPoint<Long>>

Number of steps taken while running since the start of the current active exercise.

SPEED

val SPEEDDeltaDataType<DoubleSampleDataPoint<Double>>

Speed at a specific point in time, expressed as meters/second.

SPEED_STATS

val SPEED_STATSAggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistics on speed since the start of the active exercise, expressed in meters/second.

STEPS

val STEPSDeltaDataType<LongIntervalDataPoint<Long>>

Number of steps taken since the last update.

STEPS_DAILY

val STEPS_DAILYDeltaDataType<LongIntervalDataPoint<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_MINUTEDeltaDataType<LongSampleDataPoint<Long>>

Step rate in steps/minute at a given point in time.

STEPS_PER_MINUTE_STATS

val STEPS_PER_MINUTE_STATSAggregateDataType<LongStatisticalDataPoint<Long>>

Statistics on step rate in steps/minute since the beginning of the current active exercise.

STEPS_TOTAL

val STEPS_TOTALAggregateDataType<LongCumulativeDataPoint<Long>>

Total steps taken since the start of the active exercise.

STRIDE_LENGTH

val STRIDE_LENGTHDeltaDataType<DoubleSampleDataPoint<Double>>

Distance covered by a single step in meters in double format.

STRIDE_LENGTH_STATS

val STRIDE_LENGTH_STATSAggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistics on distance covered by a single step in meters in double format.

SWIMMING_LAP_COUNT

val SWIMMING_LAP_COUNTDeltaDataType<LongIntervalDataPoint<Long>>

Count of swimming laps since the last update.

SWIMMING_LAP_COUNT_TOTAL

val SWIMMING_LAP_COUNT_TOTALAggregateDataType<LongCumulativeDataPoint<Long>>

Count of swimming laps since the start of the current active exercise.

SWIMMING_STROKES

val SWIMMING_STROKESDeltaDataType<LongIntervalDataPoint<Long>>

Number of swimming strokes taken since the last update.

SWIMMING_STROKES_TOTAL

val SWIMMING_STROKES_TOTALAggregateDataType<LongCumulativeDataPoint<Long>>

Total number of swimming strokes taken since the start of the current active exercise.

VERTICAL_OSCILLATION

val VERTICAL_OSCILLATIONDeltaDataType<DoubleSampleDataPoint<Double>>

Distance the center of mass moves up-and-down with each step in centimeters in double format.

VERTICAL_OSCILLATION_STATS

val VERTICAL_OSCILLATION_STATSAggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistic on distance the center of mass moves up-and-down with each step in centimeters in double format.

VERTICAL_RATIO

val VERTICAL_RATIODeltaDataType<DoubleSampleDataPoint<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_STATSAggregateDataType<DoubleStatisticalDataPoint<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_MAXDeltaDataType<DoubleSampleDataPoint<Double>>

Maximum rate of oxygen consumption measured at a specific point in time. Valid range 0f - 100f.

VO2_MAX_STATS

val VO2_MAX_STATSAggregateDataType<DoubleStatisticalDataPoint<Double>>

Statistics on maximum rate of oxygen consumption measured since the start of an exercise. Valid range 0f - 100f.

WALKING_STEPS

val WALKING_STEPSDeltaDataType<LongIntervalDataPoint<Long>>

Number of steps taken while walking since the last update.

WALKING_STEPS_TOTAL

val WALKING_STEPS_TOTALAggregateDataType<LongCumulativeDataPoint<Long>>

Total number of steps taken while walking since the start of the current active exercise.

Public constructors

DataType

<T : Any, D : DataPoint<T>> DataType(
    name: String,
    timeType: DataType.TimeType,
    valueClass: Class<T>,
    isAggregate: Boolean
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

name

Added in 1.0.0
val nameString

Returns the name of this DataType, e.g. "Steps".

valueClass

Added in 1.0.0
val valueClassClass<T>

Returns the underlying Class of this DataType.