# ExerciseConfig

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/data/ExerciseConfig.kt+class:androidx.health.services.client.data.ExerciseConfig) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

*** ** * ** ***


```
class ExerciseConfig
```

<br />

*** ** * ** ***

Defines configuration for an exercise tracked using Health Services.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig` instances. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#SWIMMING_POOL_LENGTH_UNSPECIFIED() = 0.0f` |

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig.Builder` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#builder(androidx.health.services.client.data.ExerciseType)(exerciseType: https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseType)` Returns a fresh new `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig.Builder`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#ExerciseConfig(androidx.health.services.client.data.ExerciseType,kotlin.collections.Set,kotlin.Boolean,kotlin.Boolean,kotlin.collections.List,android.os.Bundle,kotlin.Float,androidx.health.services.client.data.ExerciseTypeConfig,kotlin.collections.Set,kotlin.collections.Set,kotlin.collections.List)( exerciseType: https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseType, dataTypes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType<*, *>>, isAutoPauseAndResumeEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, isGpsEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, exerciseGoals: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseGoal<*>>, exerciseParams: https://developer.android.com/reference/android/os/Bundle.html, swimmingPoolLengthMeters: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, exerciseTypeConfig: https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseTypeConfig?, batchingModeOverrides: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/BatchingMode>, exerciseEventTypes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseEventType<*>>, debouncedGoals: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal<*>> )` Creates a new ExerciseConfig for an exercise tracked using Health Services |

| ### Public functions |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/BatchingMode>` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#batchingModeOverrides()` `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/BatchingMode` overrides for this exercise |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType<*, *>>` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#dataTypes()` `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType` which will be tracked for this exercise |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal<*>>` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#debouncedGoals()` `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal`s for this exercise. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseEventType<*>>` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#exerciseEventTypes()` `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseEventType`s which should be tracked for this exercise |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseGoal<*>>` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#exerciseGoals()` `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseGoal`s for this exercise. |
| `https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#exerciseParams()` `https://developer.android.com/reference/android/os/Bundle.html` bundle for specifying exercise presets, the values of an on-going exercise which can be used to pre-populate a new exercise. |
| `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseType` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#exerciseType()` `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseType` user is performing for this exercise |
| `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseTypeConfig?` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#exerciseTypeConfig()` `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseTypeConfig` containing attributes which may be modified after the exercise has started |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#isAutoPauseAndResumeEnabled()` whether auto-pause/resume is enabled for this exercise |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#isGpsEnabled()` whether GPS is enabled for this exercise. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#swimmingPoolLengthMeters()` length (in meters) of the swimming pool, or 0 if not relevant to this exercise |

## Constants

### SWIMMING_POOL_LENGTH_UNSPECIFIED

```
const val SWIMMING_POOL_LENGTH_UNSPECIFIED = 0.0f: Float
```

## Public companion functions

### builder

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
fun builder(exerciseType: ExerciseType): ExerciseConfig.Builder
```

Returns a fresh new `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig.Builder`.

| Parameters |
|---|---|
| `exerciseType: https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseType` | the `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseType` representing this exercise |

## Public constructors

### ExerciseConfig

```
ExerciseConfig(
    exerciseType: ExerciseType,
    dataTypes: Set<DataType<*, *>>,
    isAutoPauseAndResumeEnabled: Boolean,
    isGpsEnabled: Boolean,
    exerciseGoals: List<ExerciseGoal<*>> = listOf(),
    exerciseParams: Bundle = Bundle(),
    swimmingPoolLengthMeters: @FloatRange(from = 0.0) Float = SWIMMING_POOL_LENGTH_UNSPECIFIED,
    exerciseTypeConfig: ExerciseTypeConfig? = null,
    batchingModeOverrides: Set<BatchingMode> = emptySet(),
    exerciseEventTypes: Set<ExerciseEventType<*>> = emptySet(),
    debouncedGoals: List<DebouncedGoal<*>> = emptyList()
)
```

Creates a new ExerciseConfig for an exercise tracked using Health Services

## Public functions

### toString

```
open fun toString(): String
```

## Public properties

### batchingModeOverrides

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val batchingModeOverrides: Set<BatchingMode>
```

`https://developer.android.com/reference/kotlin/androidx/health/services/client/data/BatchingMode` overrides for this exercise

### dataTypes

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val dataTypes: Set<DataType<*, *>>
```

`https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType` which will be tracked for this exercise

### debouncedGoals

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health#1.1.0)

```
val debouncedGoals: List<DebouncedGoal<*>>
```

`https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal`s for this exercise. `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType`s in `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DebouncedGoal`s must also be tracked.

### exerciseEventTypes

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health#1.1.0)

```
val exerciseEventTypes: Set<ExerciseEventType<*>>
```

`https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseEventType`s which should be tracked for this exercise

### exerciseGoals

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val exerciseGoals: List<ExerciseGoal<*>>
```

`https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseGoal`s for this exercise. `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType`s in `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseGoal`s must also be tracked (i.e. contained in `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#dataTypes()`) in some form. For example, an `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseGoal` for `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType#STEPS_TOTAL()` requires that `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#dataTypes()` contains either or both of `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType#STEPS_TOTAL()` / `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType#STEPS()`.

### exerciseParams

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val exerciseParams: Bundle
```

`https://developer.android.com/reference/android/os/Bundle.html` bundle for specifying exercise presets, the values of an on-going exercise which can be used to pre-populate a new exercise.

### exerciseType

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val exerciseType: ExerciseType
```

`https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseType` user is performing for this exercise

### exerciseTypeConfig

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val exerciseTypeConfig: ExerciseTypeConfig?
```

`https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseTypeConfig` containing attributes which may be modified after the exercise has started

### isAutoPauseAndResumeEnabled

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val isAutoPauseAndResumeEnabled: Boolean
```

whether auto-pause/resume is enabled for this exercise

### isGpsEnabled

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val isGpsEnabled: Boolean
```

whether GPS is enabled for this exercise. Must be set to `true` when `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/DataType#LOCATION()` is present in `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseConfig#dataTypes()`.

### swimmingPoolLengthMeters

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

```
val swimmingPoolLengthMeters: @FloatRange(from = 0.0) Float
```

length (in meters) of the swimming pool, or 0 if not relevant to this exercise