PlatformHealthSources


class PlatformHealthSources


Dynamic types for platform health sources.

Summary

Nested types

Dynamic heart rate sensor accuracy value.

Data sources keys for platform health sources.

Constants

const Int

Heart rate data is available with high accuracy.

const Int

Heart rate data is available but the accuracy is low.

const Int

Heart rate data is available and the accuracy is medium.

const Int

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

const Int

Heart rate accuracy is unknown.

const Int

Heart rate data is currently too unreliable to be used.

Public functions

java-static DynamicBuilders.DynamicFloat
@RequiresPermission(value = Manifest.permission.ACTIVITY_RECOGNITION)
@RequiresSchemaVersion(major = 1, minor = 200)
dailyCalories()

Creates a DynamicFloat which receives the current daily calories from platform health sources.

java-static DynamicBuilders.DynamicFloat
@RequiresPermission(value = Manifest.permission.ACTIVITY_RECOGNITION)
@RequiresSchemaVersion(major = 1, minor = 200)
dailyDistanceMeters()

Creates a DynamicFloat which receives the current daily distance expressed in meters from platform health sources.

java-static DynamicBuilders.DynamicFloat
@RequiresPermission(value = Manifest.permission.ACTIVITY_RECOGNITION)
@RequiresSchemaVersion(major = 1, minor = 200)
dailyFloors()

Creates a DynamicFloat which receives the current daily floors from platform health sources.

java-static DynamicBuilders.DynamicInt32
@RequiresPermission(value = Manifest.permission.ACTIVITY_RECOGNITION)
@RequiresSchemaVersion(major = 1, minor = 200)
dailySteps()

Creates a DynamicInt32 which receives the current daily steps from platform health sources.

java-static PlatformHealthSources.DynamicHeartRateAccuracy
@RequiresPermission(value = Manifest.permission.BODY_SENSORS)
@RequiresSchemaVersion(major = 1, minor = 200)
heartRateAccuracy()

Creates a DynamicHeartRateAccuracy which receives the current heat rate sensor accuracy from platform sources.

java-static DynamicBuilders.DynamicFloat
@RequiresPermission(value = Manifest.permission.BODY_SENSORS)
@RequiresSchemaVersion(major = 1, minor = 200)
heartRateBpm()

Creates a DynamicFloat which receives the current heat rate from platform sources.

Constants

HEART_RATE_ACCURACY_HIGH

Added in 1.0.0
const val HEART_RATE_ACCURACY_HIGH = 5: Int

Heart rate data is available with high accuracy.

HEART_RATE_ACCURACY_LOW

Added in 1.0.0
const val HEART_RATE_ACCURACY_LOW = 3: Int

Heart rate data is available but the accuracy is low.

HEART_RATE_ACCURACY_MEDIUM

Added in 1.0.0
const val HEART_RATE_ACCURACY_MEDIUM = 4: Int

Heart rate data is available and the accuracy is medium.

HEART_RATE_ACCURACY_NO_CONTACT

Added in 1.0.0
const val HEART_RATE_ACCURACY_NO_CONTACT = 1: Int

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

HEART_RATE_ACCURACY_UNKNOWN

Added in 1.0.0
const val HEART_RATE_ACCURACY_UNKNOWN = 0: Int

Heart rate accuracy is unknown.

HEART_RATE_ACCURACY_UNRELIABLE

Added in 1.0.0
const val HEART_RATE_ACCURACY_UNRELIABLE = 2: Int

Heart rate data is currently too unreliable to be used.

Public functions

dailyCalories

Added in 1.0.0
@RequiresPermission(value = Manifest.permission.ACTIVITY_RECOGNITION)
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun dailyCalories(): DynamicBuilders.DynamicFloat

Creates a DynamicFloat which receives the current daily calories from platform health sources. This is the total number of calories over a day (including both BMR and active calories) and it resets when 00:00 is reached (in whatever is the timezone set at that time). This can result in the DAILY period being greater than or less than 24 hours when the timezone of the device is changed.

dailyDistanceMeters

Added in 1.0.0
@RequiresPermission(value = Manifest.permission.ACTIVITY_RECOGNITION)
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun dailyDistanceMeters(): DynamicBuilders.DynamicFloat

Creates a DynamicFloat which receives the current daily distance expressed in meters from platform health sources. This is the total distance over a day and it resets when 00:00 is reached (in whatever is the timezone set at that time). This can result in the DAILY period being greater than or less than 24 hours when the timezone of the device is changed.

dailyFloors

Added in 1.0.0
@RequiresPermission(value = Manifest.permission.ACTIVITY_RECOGNITION)
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun dailyFloors(): DynamicBuilders.DynamicFloat

Creates a DynamicFloat which receives the current daily floors from platform health sources. This is the total number of floors climbed over a day and it resets when 00:00 is reached (in whatever is the timezone set at that time). This can result in the DAILY period being greater than or less than 24 hours when the timezone of the device is changed.

dailySteps

Added in 1.0.0
@RequiresPermission(value = Manifest.permission.ACTIVITY_RECOGNITION)
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun dailySteps(): DynamicBuilders.DynamicInt32

Creates a DynamicInt32 which receives the current daily steps from platform health sources. This is the total step count over a day and it resets when 00:00 is reached (in whatever is the timezone set at that time). This can result in the DAILY period being greater than or less than 24 hours when the timezone of the device is changed.

This method provides backward compatibility and is preferred over using DAILY_STEPS directly.

heartRateAccuracy

Added in 1.0.0
@RequiresPermission(value = Manifest.permission.BODY_SENSORS)
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun heartRateAccuracy(): PlatformHealthSources.DynamicHeartRateAccuracy

Creates a DynamicHeartRateAccuracy which receives the current heat rate sensor accuracy from platform sources.

The accuracy value is one of DynamicHeartRateAccuracy constants.

heartRateBpm

Added in 1.0.0
@RequiresPermission(value = Manifest.permission.BODY_SENSORS)
@RequiresSchemaVersion(major = 1, minor = 200)
java-static fun heartRateBpm(): DynamicBuilders.DynamicFloat

Creates a DynamicFloat which receives the current heat rate from platform sources.

This method provides backward compatibility and is preferred over using HEART_RATE_BPM directly.