DataTypes

@ExperimentalGlanceWearApi
object DataTypes


A representation of health data managed by Health Services.

This provides access to various health metrics that can be used in Glance Wear Widgets, such as heart rate and daily activity totals.

Summary

Public properties

RemoteInt

Heart rate data is available with high accuracy.

RemoteInt

Heart rate data is available but the accuracy is low.

RemoteInt

Heart rate data is available and the accuracy is medium.

RemoteInt

Heart rate cannot be acquired because the sensor is not properly contacting skin.

RemoteInt

Heart rate accuracy is unknown.

RemoteInt

Heart rate data is currently too unreliable to be used.

RemoteFloat

The total number of calories burned over a day (including both BMR and active calories), expressed in kilocalories (kcal).

RemoteFloat

The total distance traveled over a day, expressed in meters.

RemoteFloat

The total number of floors climbed over a day.

RemoteInt

The total step count over a day.

RemoteInt

Heart rate sensor accuracy data.

RemoteFloat

Current heart rate, in beats per minute.

RemoteBoolean

Returns true if dailyCalories is available on the host, false otherwise.

RemoteBoolean

Returns true if dailyDistanceMeters is available on the host, false otherwise.

RemoteBoolean

Returns true if dailyFloors is available on the host, false otherwise.

RemoteBoolean

Returns true if dailySteps is available on the host, false otherwise.

Public properties

HEART_RATE_ACCURACY_HIGH

Added in 1.0.0-alpha11
val HEART_RATE_ACCURACY_HIGHRemoteInt

Heart rate data is available with high accuracy.

HEART_RATE_ACCURACY_LOW

Added in 1.0.0-alpha11
val HEART_RATE_ACCURACY_LOWRemoteInt

Heart rate data is available but the accuracy is low.

HEART_RATE_ACCURACY_MEDIUM

Added in 1.0.0-alpha11
val HEART_RATE_ACCURACY_MEDIUMRemoteInt

Heart rate data is available and the accuracy is medium.

HEART_RATE_ACCURACY_NO_CONTACT

Added in 1.0.0-alpha11
val HEART_RATE_ACCURACY_NO_CONTACTRemoteInt

Heart rate cannot be acquired because the sensor is not properly contacting skin.

HEART_RATE_ACCURACY_UNKNOWN

Added in 1.0.0-alpha11
val HEART_RATE_ACCURACY_UNKNOWNRemoteInt

Heart rate accuracy is unknown.

HEART_RATE_ACCURACY_UNRELIABLE

Added in 1.0.0-alpha11
val HEART_RATE_ACCURACY_UNRELIABLERemoteInt

Heart rate data is currently too unreliable to be used.

dailyCalories

Added in 1.0.0-alpha11
val dailyCaloriesRemoteFloat

The total number of calories burned over a day (including both BMR and active calories), expressed in kilocalories (kcal).

It resets when 00:00 is reached in the device's current timezone. This can result in the daily period being greater or less than 24 hours if the timezone is changed.

Check isDailyCaloriesAvailable to determine if this metric is available on the host.

Required permission: Manifest.permission.ACTIVITY_RECOGNITION

dailyDistanceMeters

Added in 1.0.0-alpha11
val dailyDistanceMetersRemoteFloat

The total distance traveled over a day, expressed in meters.

It resets when 00:00 is reached in the device's current timezone. This can result in the daily period being greater or less than 24 hours if the timezone is changed.

Check isDailyDistanceMetersAvailable to determine if this metric is available on the host.

Required permission: Manifest.permission.ACTIVITY_RECOGNITION

dailyFloors

Added in 1.0.0-alpha11
val dailyFloorsRemoteFloat

The total number of floors climbed over a day.

It resets when 00:00 is reached in the device's current timezone. This can result in the daily period being greater or less than 24 hours if the timezone is changed.

Check isDailyFloorsAvailable to determine if this metric is available on the host.

Required permission: Manifest.permission.ACTIVITY_RECOGNITION

dailySteps

Added in 1.0.0-alpha11
val dailyStepsRemoteInt

The total step count over a day.

It resets when 00:00 is reached in the device's current timezone. This can result in the daily period being greater or less than 24 hours if the timezone is changed.

Check isDailyStepsAvailable to determine if this metric is available on the host.

Required permission: Manifest.permission.ACTIVITY_RECOGNITION

heartRateAccuracy

Added in 1.0.0-alpha11
val heartRateAccuracyRemoteInt

Heart rate sensor accuracy data. The accuracy value is one of HEART_RATE_ACCURACY_* constants.

Required permissions are:

heartRateBpm

Added in 1.0.0-alpha11
val heartRateBpmRemoteFloat

Current heart rate, in beats per minute.

Required permissions are:

isDailyCaloriesAvailable

Added in 1.0.0-alpha11
val isDailyCaloriesAvailableRemoteBoolean

Returns true if dailyCalories is available on the host, false otherwise.

A health data type may be unavailable if the permission wasn't granted or if the host cannot retrieve it.

If false, dailyCalories will return its default value.

isDailyDistanceMetersAvailable

Added in 1.0.0-alpha11
val isDailyDistanceMetersAvailableRemoteBoolean

Returns true if dailyDistanceMeters is available on the host, false otherwise.

A health data type may be unavailable if the permission wasn't granted or if the host cannot retrieve it.

If false, dailyDistanceMeters will return its default value.

isDailyFloorsAvailable

Added in 1.0.0-alpha11
val isDailyFloorsAvailableRemoteBoolean

Returns true if dailyFloors is available on the host, false otherwise.

A health data type may be unavailable if the permission wasn't granted or if the host cannot retrieve it.

If false, dailyFloors will return its default value.

isDailyStepsAvailable

Added in 1.0.0-alpha11
val isDailyStepsAvailableRemoteBoolean

Returns true if dailySteps is available on the host, false otherwise.

A health data type may be unavailable if the permission wasn't granted or if the host cannot retrieve it.

If false, dailySteps will return its default value.