Interface HealthConstants.Exercise
-
- All Superinterfaces:
- HealthConstants.Common, HealthConstants.SessionMeasurement
- Enclosing class:
- HealthConstants
public static interface HealthConstants.Exercise extends HealthConstants.SessionMeasurement
This interface defines exercise data of the user.Properties
Properties of the following extending interfaces are available for this data type.
Exercise data has the following properties.
See more common properties by spreading this section out.Property name Description HealthConstants.Exercise.DEVICE_UUID [Mandatory]
Device identifier which provides the health dataHealthConstants.Exercise.START_TIME [Mandatory]
UTC milliseconds when the measurement is startedHealthConstants.Exercise.END_TIME [Mandatory]
UTC milliseconds after the measurement has endedIf the Samsung Health's exercise data has the same
START_TIME
andEND_TIME
,
it means the user didn't select the "PAUSE" or "STOP" button yet on Samsung Health.HealthConstants.Exercise.TIME_OFFSET [Mandatory]
Time offset in milliseconds which considers the time zone and daylight saving timeHealthConstants.Exercise.EXERCISE_TYPE [Mandatory]
Predefined exercise typeHealthConstants.Exercise.EXERCISE_CUSTOM_TYPE Custom exercise type HealthConstants.Exercise.CALORIE [Mandatory]
Burned calorieHealthConstants.Exercise.DURATION [Mandatory]
Duration of this exerciseHealthConstants.Exercise.DISTANCE Distance HealthConstants.Exercise.ALTITUDE_GAIN Increased altitude during the activity HealthConstants.Exercise.ALTITUDE_LOSS Decreased altitude during the activity HealthConstants.Exercise.COUNT Count of a repetitive action HealthConstants.Exercise.COUNT_TYPE Type of the count HealthConstants.Exercise.MAX_SPEED Maximum speed HealthConstants.Exercise.MEAN_SPEED Mean speed HealthConstants.Exercise.MAX_CALORICBURN_RATE Maximum rate of burned calories HealthConstants.Exercise.MEAN_CALORICBURN_RATE Mean rate of burned calories HealthConstants.Exercise.MAX_CADENCE Maximum cadence rate HealthConstants.Exercise.MEAN_CADENCE Mean cadence rate HealthConstants.Exercise.MAX_HEART_RATE Maximum heart rate HealthConstants.Exercise.MEAN_HEART_RATE Mean heart rate HealthConstants.Exercise.MIN_HEART_RATE Minimum heart rate HealthConstants.Exercise.MAX_ALTITUDE Maximum altitude HealthConstants.Exercise.MIN_ALTITUDE Minimum altitude HealthConstants.Exercise.INCLINE_DISTANCE Uphill distance HealthConstants.Exercise.DECLINE_DISTANCE Downhill distance HealthConstants.Exercise.MAX_POWER Maximum power HealthConstants.Exercise.MEAN_POWER Mean power HealthConstants.Exercise.MEAN_RPM Mean RPM (Revolutions Per Minute) HealthConstants.Exercise.MAX_RPM Max RPM (Revolutions Per Minute) HealthConstants.Exercise.LIVE_DATA Live data (e.g. heart rate, speed, power, and so on) during exercise HealthConstants.Exercise.LOCATION_DATA Location (trajectory) data during exercise HealthConstants.Exercise.VO2_MAX Maximal oxygen consumption during exercise. HealthConstants.Exercise.COMMENT Comment HealthConstants.Exercise.ADDITIONAL Additional info to express exercise's details HealthConstants.Exercise.CUSTOM Custom info which is formatted with JSON and compressed data Data Permission
The user's consent is required to read or write this data type. HealthPermissionManager.requestPermissions() displays a data permission UI to the user.
See Permission Manager and request data permission.- Since:
- 1.0.0
-
-
Field Summary
Fields Modifier and Type Field and Description static String
ADDITIONAL
Additional info to express exercise's details.static String
ALTITUDE_GAIN
Increased altitude during the activity in meters.static String
ALTITUDE_LOSS
Decreased altitude during the activity in meters.static String
CALORIE
Burned calorie during the activity in kilocalories.static String
COMMENT
Comment for data.static String
COUNT
Count of a repetitive action, such as the revolution count of the bicycle pedal or striding count of a runner or walker.static String
COUNT_TYPE
Type of the count.static int
COUNT_TYPE_REPETITION
General repetition type.static int
COUNT_TYPE_STRIDE
Stride or step cadence type.static int
COUNT_TYPE_STROKE
Stroke cadence type.static int
COUNT_TYPE_SWING
Swing cadence type.static String
DECLINE_DISTANCE
Downhill distance during the activity in meters.static String
DISTANCE
Distance covered during the exercise in meters.static String
DURATION
Duration of this exercise in milliseconds.static String
EXERCISE_CUSTOM_TYPE
Custom exercise type.static String
EXERCISE_TYPE
Predefined exercise type.static String
HEALTH_DATA_TYPE
Data type name for exercise.static String
INCLINE_DISTANCE
Uphill distance during the activity in meters.static String
LIVE_DATA
Live data (e.g. heart rate, speed, power, and so on) during exercise which is formatted with JSON and compressed data.static String
LOCATION_DATA
Location (trajectory) data during exercise which is formatted with JSON and compressed data.static String
MAX_ALTITUDE
Maximum altitude in meters.static String
MAX_CADENCE
Maximum cadence rate per minute.static String
MAX_CALORICBURN_RATE
Maximum rate of burned calories in kilocalories per hour.static String
MAX_HEART_RATE
Maximum heart rate per minute.static String
MAX_POWER
Maximum power in watts.static String
MAX_RPM
Max RPM (Revolutions Per Minute).static String
MAX_SPEED
Maximum speed in meters per second.static String
MEAN_CADENCE
Mean cadence rate per minute.static String
MEAN_CALORICBURN_RATE
Mean rate of burned calories in kilocalories per hour.static String
MEAN_HEART_RATE
Mean heart rate per minute.static String
MEAN_POWER
Mean power in watts.static String
MEAN_RPM
Mean RPM (Revolutions Per Minute).static String
MEAN_SPEED
Mean speed in meters per second.static String
MIN_ALTITUDE
Minimum altitude in meters.static String
MIN_HEART_RATE
Minimum heart rate per minute.static String
VO2_MAX
Maximal oxygen consumption during exercise.-
Fields inherited from interface com.samsung.android.sdk.healthdata.HealthConstants.SessionMeasurement
END_TIME, START_TIME, TIME_OFFSET
-
Fields inherited from interface com.samsung.android.sdk.healthdata.HealthConstants.Common
CREATE_TIME, CUSTOM, DEVICE_UUID, PACKAGE_NAME, UPDATE_TIME, UUID
-
-
-
-
Field Detail
-
EXERCISE_TYPE
static final String EXERCISE_TYPE
Predefined exercise type.
Your application's exercise data is shown on Samsung Health if the data sets this value.If you cannot find a proper exercise type in predefined types, set the value as
0
and setEXERCISE_CUSTOM_TYPE
instead of it.- Mandatory
- Type:
int
- Available values: predefined types
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
EXERCISE_CUSTOM_TYPE
static final String EXERCISE_CUSTOM_TYPE
Custom exercise type. Define its value as FQDN, e.g. "com.yourcompany.exercise.type.exercise_name".This property has to be used only when you cannot find a required exercise type in predefined types. If this custom type is used, set the value of
EXERCISE_TYPE
as0
. Your custom health data is inserted to the health data store but it is not shown in Samsung Health.- Optional
- Type:
String
- Value length: 1 ~ 255
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
DISTANCE
static final String DISTANCE
Distance covered during the exercise in meters.- Optional
- Type:
float
- Value range: 0 ~ 2000000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
CALORIE
static final String CALORIE
Burned calorie during the activity in kilocalories.- Mandatory
- Type:
float
- Value range: 0 ~ 1000000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
DURATION
static final String DURATION
Duration of this exercise in milliseconds.- Mandatory
- Type:
long
- Value range: 0 ~ 86400000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
ALTITUDE_GAIN
static final String ALTITUDE_GAIN
Increased altitude during the activity in meters.- Optional
- Type:
float
- Value range: 0 ~ 10000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
ALTITUDE_LOSS
static final String ALTITUDE_LOSS
Decreased altitude during the activity in meters.- Optional
- Type:
float
- Value range: 0 ~ 10000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
COUNT
static final String COUNT
Count of a repetitive action, such as the revolution count of the bicycle pedal or striding count of a runner or walker.- Optional
- Type:
int
- Value range: 0 ~ 1000000
- Since:
- 1.0.0
- See Also:
COUNT_TYPE
, Constant Field Values
-
COUNT_TYPE
static final String COUNT_TYPE
Type of the count.- Optional
- Type:
int
- Available values: one of the following values
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
COUNT_TYPE_STRIDE
static final int COUNT_TYPE_STRIDE
Stride or step cadence type.
Its constant value is30001
.- Since:
- 1.0.0
- See Also:
COUNT_TYPE
, Constant Field Values
-
COUNT_TYPE_STROKE
static final int COUNT_TYPE_STROKE
Stroke cadence type.
Its constant value is30002
.- Since:
- 1.0.0
- See Also:
COUNT_TYPE
, Constant Field Values
-
COUNT_TYPE_SWING
static final int COUNT_TYPE_SWING
Swing cadence type.
Its constant value is30003
.- Since:
- 1.0.0
- See Also:
COUNT_TYPE
, Constant Field Values
-
COUNT_TYPE_REPETITION
static final int COUNT_TYPE_REPETITION
General repetition type.
Its constant value is30004
.- Since:
- 1.3.0
- See Also:
COUNT_TYPE
, Constant Field Values
-
MAX_SPEED
static final String MAX_SPEED
Maximum speed in meters per second.- Optional
- Type:
float
- Value range: 0 ~ 140
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
MEAN_SPEED
static final String MEAN_SPEED
Mean speed in meters per second.- Optional
- Type:
float
- Value range: 0 ~ 140
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
MAX_CALORICBURN_RATE
static final String MAX_CALORICBURN_RATE
Maximum rate of burned calories in kilocalories per hour.- Optional
- Type:
float
- Value range: 0 ~ 1000000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
MEAN_CALORICBURN_RATE
static final String MEAN_CALORICBURN_RATE
Mean rate of burned calories in kilocalories per hour.- Optional
- Type:
float
- Value range: 0 ~ 1000000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
MAX_CADENCE
static final String MAX_CADENCE
Maximum cadence rate per minute.
E.g. the cadence indicates steps per minute for running exercise.- Optional
- Type:
float
- Value range: 0 ~ 500000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
MEAN_CADENCE
static final String MEAN_CADENCE
Mean cadence rate per minute.
E.g. the cadence indicates steps per minute for running exercise.- Optional
- Type:
float
- Value range: 0 ~ 500000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
MAX_HEART_RATE
static final String MAX_HEART_RATE
Maximum heart rate per minute.- Optional
- Type:
float
- Value range: 0 ~ 300
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
MEAN_HEART_RATE
static final String MEAN_HEART_RATE
Mean heart rate per minute.- Optional
- Type:
float
- Value range: 0 ~ 300
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
MIN_HEART_RATE
static final String MIN_HEART_RATE
Minimum heart rate per minute.- Optional
- Type:
float
- Value range: 0 ~ 300
- Since:
- 1.2.0
- See Also:
- Constant Field Values
-
MAX_ALTITUDE
static final String MAX_ALTITUDE
Maximum altitude in meters.- Optional
- Type:
float
- Value range: -1000 ~ 10000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
MIN_ALTITUDE
static final String MIN_ALTITUDE
Minimum altitude in meters.- Optional
- Type:
float
- Value range: -1000 ~ 10000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
INCLINE_DISTANCE
static final String INCLINE_DISTANCE
Uphill distance during the activity in meters.- Optional
- Type:
float
- Value range: 0 ~ 1000000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
DECLINE_DISTANCE
static final String DECLINE_DISTANCE
Downhill distance during the activity in meters.- Optional
- Type:
float
- Value range: 0 ~ 1000000
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
MAX_POWER
static final String MAX_POWER
Maximum power in watts.- Optional
- Type:
float
- Value range: 0 ~ 999
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
MEAN_POWER
static final String MEAN_POWER
Mean power in watts.- Optional
- Type:
float
- Value range: 0 ~ 999
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
MEAN_RPM
static final String MEAN_RPM
Mean RPM (Revolutions Per Minute).- Optional
- Type:
float
- Value range: 0 ~ 100000
- Since:
- 1.2.1
- See Also:
- Constant Field Values
-
MAX_RPM
static final String MAX_RPM
Max RPM (Revolutions Per Minute).- Optional
- Type:
float
- Value range: 0 ~ 100000
- Since:
- 1.3.0
- See Also:
- Constant Field Values
-
LIVE_DATA
static final String LIVE_DATA
Live data (e.g. heart rate, speed, power, and so on) during exercise which is formatted with JSON and compressed data.- Optional
- Type:
byte[]
- Maximum data size: 1000 KB
Live data can have one or more segments.
E.g. Samsung Health starts the exercise data record when the user starts a specified exercise. It makes several segments to live data for each specific period. When the user tabs the 'stop' button finally it finishes the exercise data record.Each segment is composed of the following JSON keys.
JSON key Type Unit Mandatory "start_time" long
UTC millisecond Recommended.
Set this value if you saveLIVE_DATA
."heart_rate" float
Beat per minute Recommended.
Set one or more values if you saveLIVE_DATA
."cadence" float
Rate per minute "count" int
- "power" float
Watt "speed" float
Meter per second "distance" float
Meter The following example shows the JSON format for
LIVE_DATA
.
Especially, each segment's "{ "start_time":1422457096536, "heart_rate":147.48181, "cadence":95.84712, "count":83, "power":99.50436, "speed":11.061617, "distance":250 }
count
" and "distance
" in live data are accumulated values to the each segment's "start_time
"unlike other values such as "heart_rate
" and "cadence
" that indicate the measured value at the point of each segment's "start_time
".Compressed JSON conversion can be:
- Since:
- 1.0.0
- See Also:
HealthDataUtil
, Constant Field Values
-
LOCATION_DATA
static final String LOCATION_DATA
Location (trajectory) data during exercise which is formatted with JSON and compressed data.
It follows WGS 84.- Optional
- Type:
byte[]
- Maximum data size: 1000 KB
Location data can have one or more segment.
Each segment is composed of the following JSON Keys.JSON key Type Mandatory "start_time" long
Recommended,
Set this value if you saveLOCATION_DATA
."latitude" float
Recommended,
Set this value if you saveLOCATION_DATA
."longitude" float
Recommended,
Set this value if you saveLOCATION_DATA
."altitude" float
No "accuracy" float
No The following example shows the JSON format for
LOCATION_DATA
{ "start_time":1422457096536, "latitude":2.7413864, "longitude":60.37224, "altitude":39.0, "accuracy":0.0 }
Compressed JSON conversion can be:
- Since:
- 1.0.0
- See Also:
HealthDataUtil
, Constant Field Values
-
VO2_MAX
static final String VO2_MAX
Maximal oxygen consumption during exercise.- Optional
- Type:
float
- Value range: 0 ~ 100
- Since:
- 1.5.0
- See Also:
- Constant Field Values
-
COMMENT
static final String COMMENT
Comment for data.- Optional
- Type:
String
- Value length: 0 ~ 255
- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
ADDITIONAL
static final String ADDITIONAL
Additional info to express exercise's details.
It is formatted with JSON and compressed data. It's different for each exercise kind.Compressed JSON conversion can be:
Swimming's Additional Info
Swimming's detailed information is defined with the following JSON keys.
JSON key Type Unit Mandatory Remarks "pool_length" int
- Yes 20 | 50 | ... "pool_length_unit" String
- Yes One of the following value: - "meter"
- "yard"
"total_distance" float
meter Yes "total_duration" int
millisecond Yes "lengths" Array
- No Array of length A length is the distance from one end of a swimming pool to the other.
Each length's detailed information is defined with the following JSON keys.JSON key Type Unit Mandatory Description "duration" int
millisecond Yes Duration value of this length "stroke_count" int
- Yes Stroke count value of this length "stroke_type" String
- Yes Stroke type value of this length
One of the following value:- "Freestyle"
- "Butterfly"
- "Backstroke"
- "Breaststroke"
- "Mixed"
"interval" int
- Yes Interval value.
It starts from 1 and increments by 1.See swimming data's example additional info.
{ "pool_length":25, "pool_length_unit":"meter", "total_distance":125, "total_duration":247000, "lengths":[ { "duration":49000, "interval":1, "stroke_count":20, "stroke_type":"Butterfly" }, { "duration":42000, "interval":1, "stroke_count":21, "stroke_type":"Backstroke" }, { "duration":51000, "interval":1, "stroke_count":26, "stroke_type":"Breaststroke" }, { "duration":52000, "interval":2, "stroke_count":27, "stroke_type":"Freestyle" }, { "duration":53000, "interval":2, "stroke_count":29, "stroke_type":"Mixed" } ] }
- Since:
- 1.3.0
- See Also:
- Constant Field Values
-
HEALTH_DATA_TYPE
static final String HEALTH_DATA_TYPE
Data type name for exercise.
Use"com.samsung.health.exercise"
to add permission to the manifest file.- Since:
- 1.0.0
- See Also:
- Constant Field Values
-
-