ExerciseType

The data type representing exercise data specifications.

One ExerciseType data record includes one or more ExerciseSessions.

Each ExerciseSession indicates a single exercise activity with:

This allows for flexibility in recording diverse types of exercise activities.

If a single running exercise activity is provided with the ExerciseType, the ExerciseType data record includes one ExerciseSession for the RUNNING exercise type.

In case of triathlon, it can be expressed with one the ExerciseType data record including 3 ExerciseSessions for SWIMMING, BIKING, and RUNNING.

Predefined instance

Using the following instance allows for obtaining exercise data with more concise code.

Available aggregate operations

  • TOTAL_CALORIES
    : To get the total calories within the received exercise data for a data request.

  • TOTAL_DURATION
    : To get the total duration within the received exercise data for a data request.

Required permission

The user's consent is required to access this data type. Check the granted permissions and request permissions if the required permission is not granted yet with:

See a code example in here.

Available requests

Data specifications

This data type includes the following information.

PropertyDescription
uid[Mandatory]
The data's unique identifier assigned by the Samsung Health.
startTime[Mandatory]
The timestamp representing the start of measurement, specified as Instant, in milliseconds.
endTime[Mandatory]
The timestamp representing the end of measurement, specified as Instant, in milliseconds.
zoneOffset[Mandatory]
The ZoneOffset for startTime and endTime.
dataSource[Mandatory]
The data's source information including the application package name and which device's ID.
EXERCISE_TYPE[Mandatory]
The exercise type.
SESSIONS[Mandatory]
The list of ExerciseSession.
CUSTOM_TITLEThe custom title of the exercise type. It's used if there is no proper PredefinedExerciseType for the EXERCISE_TYPE.

Auto detect workouts of Galaxy wearable

The Galaxy Watch, Galaxy Fit, and Galaxy Ring support the auto-detect workouts feature. If the user enabled the [Samsung Health] > [Settings] > [Activities to detect[, the Samsung Health detects the user's workout automatically and records the detected workout data as ExerciseType data.

Inserting exercise data into Samsung Health

For inserting exercise data into the Samsung Health, please take note of the following:

If there are two or more ExerciseSessions in the exercise data, set the startTime and endTime of each ExerciseSession within the range of startTime and endTime of the ExerciseType data, and ensure they do not overlap with any other ExerciseSession within the ExerciseType data.

Since

1.0.0

Types

Link copied to clipboard
object Companion
Link copied to clipboard

The count type for a countable exercise.

Link copied to clipboard

The type of swimming stroke.

Properties

Link copied to clipboard

Retrieves a ChangedDataRequest instance to retrieve changed exercise data.

Link copied to clipboard

Gets the appropriate builder for creating DeleteDataRequest.

Link copied to clipboard

Gets the appropriate builder for creating InsertDataRequest.

Link copied to clipboard

Retrieves a ReadDataRequest instance to read exercise data.

Link copied to clipboard

Gets the appropriate builder for creating UpdateDataRequest.

Preferences Submitted

You have successfully updated your cookie preferences.