Stay organized with collections
Save and categorize content based on your preferences.
ExerciseSessionRecord
class ExerciseSessionRecord : IntervalRecord
Captures exercise or a sequence of exercises. This can be a playing game like football or a sequence of fitness exercises.
Each record needs a start time, end time and session type. In addition, each record has two optional independent lists of time intervals: ExerciseSegment
represents particular exercise within session, ExerciseLap
represents a lap time within session.
Summary
Properties |
static AggregationType<Long!> |
Metric identifier to retrieve total exercise session duration using aggregate APIs in .
|
Public methods
equals
fun equals(other: Any?): Boolean
Parameters |
obj |
the reference object with which to compare. |
object |
the reference object with which to compare. This value may be null . |
Return |
Boolean |
true if this object is the same as the obj |
getExerciseType
fun getExerciseType(): Int
Returns exerciseType of this session.
Return |
Int |
Value is android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_UNKNOWN , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BADMINTON , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BASEBALL , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BASKETBALL , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BIKING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BIKING_STATIONARY , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BOOT_CAMP , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_BOXING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_CALISTHENICS , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_CRICKET , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_DANCING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ELLIPTICAL , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_EXERCISE_CLASS , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_FENCING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_FOOTBALL_AMERICAN , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_FOOTBALL_AUSTRALIAN , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_FRISBEE_DISC , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_GOLF , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_GUIDED_BREATHING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_GYMNASTICS , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_HANDBALL , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_HIGH_INTENSITY_INTERVAL_TRAINING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_HIKING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ICE_HOCKEY , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ICE_SKATING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_MARTIAL_ARTS , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_PADDLING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_PARAGLIDING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_PILATES , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_RACQUETBALL , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ROCK_CLIMBING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ROLLER_HOCKEY , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ROWING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_ROWING_MACHINE , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_RUGBY , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_RUNNING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_RUNNING_TREADMILL , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SAILING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SCUBA_DIVING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SKATING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SKIING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SNOWBOARDING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SNOWSHOEING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SOCCER , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SOFTBALL , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SQUASH , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_STAIR_CLIMBING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_STAIR_CLIMBING_MACHINE , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_STRENGTH_TRAINING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_STRETCHING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SURFING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SWIMMING_OPEN_WATER , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_SWIMMING_POOL , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_TABLE_TENNIS , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_TENNIS , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_VOLLEYBALL , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_WALKING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_WATER_POLO , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_WEIGHTLIFTING , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_WHEELCHAIR , android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_OTHER_WORKOUT , or android.health.connect.datatypes.ExerciseSessionType#EXERCISE_SESSION_TYPE_YOGA |
getLaps
fun getLaps(): MutableList<ExerciseLap!>
Returns laps of this session. Returns empty list if the session doesn't have exercise laps.
getNotes
fun getNotes(): CharSequence?
Returns notes for this activity. Returns null if the session doesn't have notes.
getPlannedExerciseSessionId
fun getPlannedExerciseSessionId(): String?
Returns the ID of the PlannedExerciseSessionRecord
that this session was based upon. If not set, returns null.
getRoute
fun getRoute(): ExerciseRoute?
Returns route of this session. Returns null if the session doesn't have route.
getSegments
fun getSegments(): MutableList<ExerciseSegment!>
Returns segments of this session. Returns empty list if the session doesn't have exercise segments.
getTitle
fun getTitle(): CharSequence?
Returns title of this session. Returns null if the session doesn't have title.
hasRoute
fun hasRoute(): Boolean
Returns if this session has recorded route.
Return |
Boolean |
This value cannot be null . |
hashCode
fun hashCode(): Int
Return |
Int |
a hash code value for this object. |
Properties
EXERCISE_DURATION_TOTAL
static val EXERCISE_DURATION_TOTAL: AggregationType<Long!>
Metric identifier to retrieve total exercise session duration using aggregate APIs in . Calculated in milliseconds.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.