ExerciseConfig.Builder

public final class ExerciseConfig.Builder


Builder for ExerciseConfig instances.

Summary

Public constructors

Public methods

final @NonNull ExerciseConfig

Returns the built ExerciseConfig.

final @NonNull ExerciseConfig.Builder
setAutoPauseAndResume(boolean autoPauseAndResume)

Sets whether auto pause and auto resume are enabled for this exercise.

final @NonNull ExerciseConfig.Builder

Sets the requested DataType s that should be tracked during this exercise.

final @NonNull ExerciseConfig.Builder

Sets ExerciseGoal s specified for this exercise.

final @NonNull ExerciseConfig.Builder
setExerciseParams(@NonNull Bundle exerciseParams)

Sets additional parameters for current exercise.

final @NonNull ExerciseConfig.Builder

Sets the active ExerciseType the user is performing for this exercise.

Public constructors

Builder

public final Builder()

Public methods

build

@NonNull
public final ExerciseConfig build()

Returns the built ExerciseConfig.

setAutoPauseAndResume

@NonNull
public final ExerciseConfig.Builder setAutoPauseAndResume(boolean autoPauseAndResume)

Sets whether auto pause and auto resume are enabled for this exercise. If not set, they're disabled by default.

setDataTypes

@NonNull
public final ExerciseConfig.Builder setDataTypes(@NonNull Set<@NonNull DataType> dataTypes)

Sets the requested DataType s that should be tracked during this exercise. If not explicitly called, a default set of DataType will be chosen based on the [ ].

setExerciseGoals

@NonNull
public final ExerciseConfig.Builder setExerciseGoals(@NonNull List<@NonNull ExerciseGoal> exerciseGoals)

Sets ExerciseGoal s specified for this exercise.

This is useful to have goals specified before the start of an exercise.

setExerciseParams

@NonNull
public final ExerciseConfig.Builder setExerciseParams(@NonNull Bundle exerciseParams)

Sets additional parameters for current exercise. Supported keys can be found in ExerciseConfig.

setExerciseType

@NonNull
public final ExerciseConfig.Builder setExerciseType(@NonNull ExerciseType exerciseType)

Sets the active ExerciseType the user is performing for this exercise.

Provide this parameter when tracking a workout to provide more accurate data. This information can be used to tune sensors, e.g. the calories estimate can take the MET value into account.