com.samsung.health.exercise

This data type defines exercise data of the user.

Property Type Description
"datauuid" string [Mandatory]
Unique ID for each health data.
This value should be format of UUID, the 32 hexadecimal digits displayed in five groups separated by hyphens in the form 8-4-4-4-12. It is highly encouraged to generate it using random UUID generator.
  • Value length: 10 ~ 36

"create_time" long [Mandatory]
UTC milliseconds when a data is created in the health data store.
It is different with "start_time" that indicates the start time for measurement.
  • Value range: 0 and above

"update_time" long [Mandatory]
UTC milliseconds when a data is updated.
You don't need to set its value. When a new data is inserted, it is assigned as the same value with "create_time" by the system. Then it is replaced to the updated time by the system if existing health data is updated.
  • Value range: 0 and above

"pkg_name" string [Mandatory]
Package name which provides a data.
You don't need to set its value because it is assigned by the system when a new data is inserted.
  • Value length: 0 ~ 64

"deviceuuid" string [Mandatory]
Device identifier of the source device which provides a health data.
  • Value length: 10 ~ 36

"start_time" long [Mandatory]
UTC milliseconds when the measurement is started.
"time_off" needs to set for showing the data's measured time properly.
  • Value range: 0 and above

"end_time" long [Mandatory]
UTC milliseconds after the measurement has ended.
"time_off" needs to set for showing the data's measured time properly.
  • Value range: equal or bigger than "start_time"

"time_offset" long [Mandatory]
Time offset in milliseconds which considers the time zone and daylight saving time.
E.g. Tehran (UTC+3:30) is presented as 12600000 (3.5 * 60 * 60 * 1000).
It affects to "start_time" to show the measured time properly to the user.
  • Value range: -43200000 (-12 * 60 * 60 * 1000) ~ 50400000 (14 * 60 * 60 * 1000)

"calorie" float [Mandatory]
Burned calorie during the activity in kilocalories.
  • Value range: 0 ~ 1000000

"duration" long [Mandatory]
Duration of this exercise in milliseconds.
  • Value range: 0 ~ 86400000

"exercise_type" int 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 set "exercise_custom_type" instead of it.
"exercise_custom_type" text 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 as 0. Your custom health data is inserted to the health data store but it is not shown in Samsung Health.
  • Value length: 1 ~ 255

"distance" float Distance covered during the exercise in meters.
  • Value range: 0 ~ 2000000

"altitude_gain" long Duration of this exercise in milliseconds.
  • Value range: 0 ~ 86400000

"altitude_loss" float Decreased altitude during the activity in meters.
  • Value range: 0 ~ 10000

"count" int Count of a repetitive action, such as the revolution count of the bicycle pedal or striding count of a runner or walker.
  • Value range: 0 ~ 1000000

"count_type" int Type of the count.
  • Available values: one of the following values

Value Description
30001 Stride or step cadence type.
30002 Stroke cadence type.
30003 Swing cadence type.
30004 General repetition type.
"max_speed" float Maximum speed in meters per second.
  • Value range: 0 ~ 140

"mean_speed" float Mean speed in meters per second.
  • Value range: 0 ~ 140

"max_caloricburn_rate" float Maximum rate of burned calories in kilocalories per hour.
  • Value range: 0 ~ 1000000

"mean_caloricburn_rate" float Mean rate of burned calories in kilocalories per hour.
  • Value range: 0 ~ 1000000

"max_cadence" float Maximum cadence rate per minute.
  • Value range: 0 ~ 500000

"mean_cadence" float Mean cadence rate per minute.
  • Value range: 0 ~ 500000

"max_heart_rate" float Maximum heart rate per minute.
  • Value range: 0 ~ 300

"mean_heart_rate" float Mean heart rate per minute.
  • Value range: 0 ~ 300

"min_heart_rate" float Minimum heart rate per minute.
  • Value range: 0 ~ 300

"max_altitude" float Maximum altitude in meters.
  • Value range: -1000 ~ 10000

"min_altitude" float Minimum altitude in meters.
  • Value range: -1000 ~ 10000

"incline_distance" float Uphill distance during the activity in meters.
  • Value range: 0 ~ 1000000

"decline_distance" float Downhill distance during the activity in meters.
  • Value range: 0 ~ 1000000

"max_power" float Maximum power in watts.
  • Value range: 1 ~ 100

"mean_power" float Mean power in watts.
  • Value range: 1 ~ 100

max_rpm" float
Max RPM (Revolutions Per Minute).
  • alue range: 0 ~ 100000

"mean_rpm" float Mean RPM (Revolutions Per Minute).
  • Value range: 0 ~ 100000

"live_data" blob Live data (e.g. heart rate, speed, power, and so on) during exercise which is formatted with JSON and compressed data.
  • 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 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".
"location_data" blob Location (trajectory) data during exercise which is formatted with JSON and compressed data.
It follows WGS 84.
  • 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 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
 } 
"additional" Additional info to express exercise's details.
It is formatted with JSON and compressed data. It's different for each exercise kind.

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.
A length is the distance from one end of a swimming pool to the other.
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"
         }
     ]
} 
"comment" string Comment for data.
  • Value length: 0 ~ 255

"custom" blob Custom info which is formatted with JSON and compressed data.