public static interface HealthConstants.Exercise extends HealthConstants.SessionMeasurement
Properties of the following extending interfaces are available for this data type.
Exercise data has the following properties.
Property name | Description |
---|---|
HealthConstants.Exercise.DEVICE_UUID | [Mandatory] Device identifier which provides the health data |
HealthConstants.Exercise.START_TIME | [Mandatory] UTC milliseconds when the measurement is started |
HealthConstants.Exercise.END_TIME | [Mandatory] UTC milliseconds after the measurement has ended
If the Samsung Health's exercise data has the same |
HealthConstants.Exercise.TIME_OFFSET | [Mandatory] Time offset in milliseconds which considers the time zone and daylight saving time |
HealthConstants.Exercise.EXERCISE_TYPE | [Mandatory] Predefined exercise type |
HealthConstants.Exercise.EXERCISE_CUSTOM_TYPE | Custom exercise type |
HealthConstants.Exercise.CALORIE | [Mandatory] Burned calorie |
HealthConstants.Exercise.DURATION | [Mandatory] Duration of this exercise |
HealthConstants.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 |
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.
|
END_TIME, START_TIME, TIME_OFFSET
CREATE_TIME, CUSTOM, DEVICE_UUID, PACKAGE_NAME, UPDATE_TIME, UUID
static final String EXERCISE_TYPE
If you cannot find a proper exercise type in predefined types,
set the value as 0
and set EXERCISE_CUSTOM_TYPE
instead of it.
int
static final String EXERCISE_CUSTOM_TYPE
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
as 0
.
Your custom health data is inserted to the health data store but it is not shown in Samsung Health.
String
static final String DISTANCE
float
static final String CALORIE
float
static final String DURATION
long
static final String ALTITUDE_GAIN
float
static final String ALTITUDE_LOSS
float
static final String COUNT
int
COUNT_TYPE
,
Constant Field Valuesstatic final String COUNT_TYPE
int
static final int COUNT_TYPE_STRIDE
30001
.COUNT_TYPE
,
Constant Field Valuesstatic final int COUNT_TYPE_STROKE
30002
.COUNT_TYPE
,
Constant Field Valuesstatic final int COUNT_TYPE_SWING
30003
.COUNT_TYPE
,
Constant Field Valuesstatic final int COUNT_TYPE_REPETITION
30004
.COUNT_TYPE
,
Constant Field Valuesstatic final String MAX_SPEED
float
static final String MEAN_SPEED
float
static final String MAX_CALORICBURN_RATE
float
static final String MEAN_CALORICBURN_RATE
float
static final String MAX_CADENCE
float
static final String MEAN_CADENCE
float
static final String MAX_HEART_RATE
float
static final String MEAN_HEART_RATE
float
static final String MIN_HEART_RATE
float
static final String MAX_ALTITUDE
float
static final String MIN_ALTITUDE
float
static final String INCLINE_DISTANCE
float
static final String DECLINE_DISTANCE
float
static final String MAX_POWER
float
static final String MEAN_POWER
float
static final String MEAN_RPM
float
static final String MAX_RPM
float
static final String LIVE_DATA
byte[]
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 save LIVE_DATA . |
"heart_rate" | float |
Beat per minute | Recommended. Set one or more values if you save LIVE_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
.
{ "start_time":1422457096536, "heart_rate":147.48181, "cadence":95.84712, "count":83, "power":99.50436, "speed":11.061617, "distance":250 }Especially, each segment's "
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:
HealthDataUtil
,
Constant Field Valuesstatic final String LOCATION_DATA
byte[]
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 save LOCATION_DATA . |
"latitude" | float |
Recommended, Set this value if you save LOCATION_DATA . |
"longitude" | float |
Recommended, Set this value if you save LOCATION_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:
HealthDataUtil
,
Constant Field Valuesstatic final String VO2_MAX
float
static final String COMMENT
String
static final String ADDITIONAL
Compressed JSON conversion can be:
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:
|
"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:
|
"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" } ] }
static final String HEALTH_DATA_TYPE
"com.samsung.health.exercise"
to add permission to the manifest file.Copyright © Samsung Electronics, Co., Ltd. All rights reserved.