PlatformHealthSources


public 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

static final int

Heart rate data is available with high accuracy.

static final int

Heart rate data is available but the accuracy is low.

static final int

Heart rate data is available and the accuracy is medium.

static final int

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

static final int

Heart rate accuracy is unknown.

static final int

Heart rate data is currently too unreliable to be used.

Public methods

static @NonNull 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.

static @NonNull 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.

static @NonNull 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.

static @NonNull 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.

static @NonNull 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.

static @NonNull 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
public static final int HEART_RATE_ACCURACY_HIGH = 5

Heart rate data is available with high accuracy.

HEART_RATE_ACCURACY_LOW

Added in 1.0.0
public static final int HEART_RATE_ACCURACY_LOW = 3

Heart rate data is available but the accuracy is low.

HEART_RATE_ACCURACY_MEDIUM

Added in 1.0.0
public static final int HEART_RATE_ACCURACY_MEDIUM = 4

Heart rate data is available and the accuracy is medium.

HEART_RATE_ACCURACY_NO_CONTACT

Added in 1.0.0
public static final int HEART_RATE_ACCURACY_NO_CONTACT = 1

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

HEART_RATE_ACCURACY_UNKNOWN

Added in 1.0.0
public static final int HEART_RATE_ACCURACY_UNKNOWN = 0

Heart rate accuracy is unknown.

HEART_RATE_ACCURACY_UNRELIABLE

Added in 1.0.0
public static final int HEART_RATE_ACCURACY_UNRELIABLE = 2

Heart rate data is currently too unreliable to be used.

Public methods

dailyCalories

Added in 1.0.0
@RequiresPermission(value = Manifest.permission.ACTIVITY_RECOGNITION)
@RequiresSchemaVersion(major = 1, minor = 200)
public static @NonNull DynamicBuilders.DynamicFloat dailyCalories()

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)
public static @NonNull DynamicBuilders.DynamicFloat dailyDistanceMeters()

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)
public static @NonNull DynamicBuilders.DynamicFloat dailyFloors()

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)
public static @NonNull DynamicBuilders.DynamicInt32 dailySteps()

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)
public static @NonNull PlatformHealthSources.DynamicHeartRateAccuracy heartRateAccuracy()

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)
public static @NonNull DynamicBuilders.DynamicFloat heartRateBpm()

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.