DataType

public data final class DataType


A data type is a representation of health data managed by Health Services.

A DataType specifies the format of the values inside a DataPoint. Health Services defines data types for instantaneous observations TimeType.SAMPLE(e.g. heart rate) and data types for change between readings TimeType.INTERVAL(e.g. distance).

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.

Summary

Nested types

DataType.Companion
DataType.TimeType

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

Public fields

final int

Returns the expected format for a Value of this DataType.

final @NonNull String

Returns the name of this DataType, e.g.

final @NonNull DataType.TimeType

Returns the TimeType of this DataType.

Public constructors

DataType(
    @NonNull String name,
    @NonNull DataType.TimeType timeType,
    int format
)

Public methods

int
void
writeToParcel(@NonNull Parcel dest, int flags)

Public fields

format

@NonNull
public final int format

Returns the expected format for a Value of this DataType.

name

@NonNull
public final @NonNull String name

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

timeType

@NonNull
public final @NonNull DataType.TimeType timeType

Returns the TimeType of this DataType.

Public constructors

DataType

public final DataType(
    @NonNull String name,
    @NonNull DataType.TimeType timeType,
    int format
)

Public methods

describeContents

@NonNull
public int describeContents()

writeToParcel

@NonNull
public void writeToParcel(@NonNull Parcel dest, int flags)