PlatformHealthSources
public class PlatformHealthSources
Dynamic types for platform health sources.
Summary
Nested types |
|---|
public final class PlatformHealthSources.DynamicHeartRateAccuracy implements DynamicBuilders.DynamicInt32Dynamic heart rate sensor accuracy value. |
public class PlatformHealthSources.KeysData 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. |
Constants
HEART_RATE_ACCURACY_HIGH
public static final int HEART_RATE_ACCURACY_HIGH = 5
Heart rate data is available with high accuracy.
HEART_RATE_ACCURACY_LOW
public static final int HEART_RATE_ACCURACY_LOW = 3
Heart rate data is available but the accuracy is low.
HEART_RATE_ACCURACY_MEDIUM
public static final int HEART_RATE_ACCURACY_MEDIUM = 4
Heart rate data is available and the accuracy is medium.
HEART_RATE_ACCURACY_NO_CONTACT
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
public static final int HEART_RATE_ACCURACY_UNKNOWN = 0
Heart rate accuracy is unknown.
HEART_RATE_ACCURACY_UNRELIABLE
public static final int HEART_RATE_ACCURACY_UNRELIABLE = 2
Heart rate data is currently too unreliable to be used.
Public methods
dailyCalories
@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
@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
@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
@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
@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
@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.