public enum HealthDataKind
- Object
- Enum<HealthDataKind>
- HealthDataKind
ImplementsComparable<HealthDataKind>
HealthDataType produces, and therefore which
HealthSample subclass a query for it returns.Enum constants
QUANTITY | A numeric measurement with a unit – steps, heart rate, body mass. |
CATEGORY | An enumerated observation with no natural unit – menstrual flow, a single sleep stage. |
SERIES | A run of measurements sharing one record identity – a beat-to-beat heart-rate trace. |
SESSION | A bounded activity with child data – a workout, a night’s sleep. |
COMPOSITE | A reading made of several named values that only mean something together – a blood pressure, which is a systolic and a diastolic. |
Methods
public static HealthDataKind[] values() | |
public static HealthDataKind valueOf(String name) |
Inherited methods
Enum constant details
QUANTITY
QUANTITYQuantitySample. Maps to HKQuantitySample and to Health
Connect’s numeric record types.CATEGORY
CATEGORYCategorySample. Maps to
HKCategorySample.SERIES
SERIESA run of measurements sharing one record identity – a
beat-to-beat heart-rate trace. Produces SeriesSample.
This kind exists because the two platforms disagree: Health
Connect’s HeartRateRecord is one record containing N samples,
while HealthKit returns N independent samples. See
SampleQuery.setFlattenSeries(boolean).
SESSION
SESSIONSessionSample subclass.COMPOSITE
COMPOSITEA reading made of several named values that only mean something
together – a blood pressure, which is a systolic and a
diastolic. Produces BloodPressureSample.
It is not QUANTITY. Calling it one let generic code dispatch on
the kind, cast a stored reading to QuantitySample and fail with
a ClassCastException – and let a caller build a one-number
quantity for a type that has no single number, which the platforms
then had to refuse or, worse, store as half a reading.
Method details
values
public static HealthDataKind[] values()valueOf
public static HealthDataKind valueOf(String name)