# ActivityIntensityRecord

Artifact: [androidx.health.connect:connect-client](https://developer.android.com/jetpack/androidx/releases/health-connect) [View Source](https://cs.android.com/search?q=file:androidx/health/connect/client/records/ActivityIntensityRecord.kt+class:androidx.health.connect.client.records.ActivityIntensityRecord) Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

*** ** * ** ***


```
class ActivityIntensityRecord : Record
```

<br />

*** ** * ** ***

Represents intensity of an activity.

Intensity can be either moderate or vigorous.

Each record requires the start time, the end time and the activity intensity type.

The ability to insert or read this record type is dependent on the version of Health Connect installed on the device. To check if available: call `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` and pass `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#FEATURE_ACTIVITY_INTENSITY()` as an argument.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#ACTIVITY_INTENSITY_TYPE_MODERATE() = 0` Moderate intensity activity |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#ACTIVITY_INTENSITY_TYPE_VIGOROUS() = 1` Vigorous intensity activity. |

| ### Public companion properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric<https://developer.android.com/reference/java/time/Duration.html>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#DURATION_TOTAL()` Metric identifier to retrieve the total duration of activity intensity regardless of the type from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. |
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#INTENSITY_MINUTES_TOTAL()` Metric identifier to retrieve the number of weighted intensity minutes from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. |
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric<https://developer.android.com/reference/java/time/Duration.html>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#MODERATE_DURATION_TOTAL()` Metric identifier to retrieve the total duration of moderate activity intensity from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. |
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric<https://developer.android.com/reference/java/time/Duration.html>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#VIGOROUS_DURATION_TOTAL()` Metric identifier to retrieve the total duration of vigorous activity intensity from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#ActivityIntensityRecord(java.time.Instant,java.time.ZoneOffset,java.time.Instant,java.time.ZoneOffset,androidx.health.connect.client.records.metadata.Metadata,kotlin.Int)( startTime: https://developer.android.com/reference/java/time/Instant.html, startZoneOffset: https://developer.android.com/reference/java/time/ZoneOffset.html?, endTime: https://developer.android.com/reference/java/time/Instant.html, endZoneOffset: https://developer.android.com/reference/java/time/ZoneOffset.html?, metadata: https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata, activityIntensityType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#activityIntensityType()` Type of activity intensity (moderate or vigorous). |
| `open https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#endTime()` End time of the record. |
| `open https://developer.android.com/reference/java/time/ZoneOffset.html?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#endZoneOffset()` User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/IntervalRecord#endTime()`, or null if unknown. |
| `open https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#metadata()` Set of common metadata associated with the written record. |
| `open https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#startTime()` Start time of the record. |
| `open https://developer.android.com/reference/java/time/ZoneOffset.html?` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/ActivityIntensityRecord#startZoneOffset()` User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/IntervalRecord#startTime()`, or null if unknown. |

## Constants

### ACTIVITY_INTENSITY_TYPE_MODERATE

```
const val ACTIVITY_INTENSITY_TYPE_MODERATE = 0: Int
```

Moderate intensity activity

### ACTIVITY_INTENSITY_TYPE_VIGOROUS

```
const val ACTIVITY_INTENSITY_TYPE_VIGOROUS = 1: Int
```

Vigorous intensity activity.

## Public companion properties

### DURATION_TOTAL

```
val DURATION_TOTAL: AggregateMetric<Duration>
```

Metric identifier to retrieve the total duration of activity intensity regardless of the type from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. To check if this metric is available, use `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` with `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#FEATURE_ACTIVITY_INTENSITY()` as the argument.

### INTENSITY_MINUTES_TOTAL

```
val INTENSITY_MINUTES_TOTAL: AggregateMetric<Long>
```

Metric identifier to retrieve the number of weighted intensity minutes from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. To check if this metric is available, use `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` with `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#FEATURE_ACTIVITY_INTENSITY()` as the argument.

### MODERATE_DURATION_TOTAL

```
val MODERATE_DURATION_TOTAL: AggregateMetric<Duration>
```

Metric identifier to retrieve the total duration of moderate activity intensity from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. To check if this metric is available, use `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` with `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#FEATURE_ACTIVITY_INTENSITY()` as the argument.

### VIGOROUS_DURATION_TOTAL

```
val VIGOROUS_DURATION_TOTAL: AggregateMetric<Duration>
```

Metric identifier to retrieve the total duration of vigorous activity intensity from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`. To check if this metric is available, use `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` with `https://developer.android.com/reference/kotlin/androidx/health/connect/client/HealthConnectFeatures#FEATURE_ACTIVITY_INTENSITY()` as the argument.

## Public constructors

### ActivityIntensityRecord

Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

```
ActivityIntensityRecord(
    startTime: Instant,
    startZoneOffset: ZoneOffset?,
    endTime: Instant,
    endZoneOffset: ZoneOffset?,
    metadata: Metadata,
    activityIntensityType: Int
)
```

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

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

## Public properties

### activityIntensityType

Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

```
val activityIntensityType: Int
```

Type of activity intensity (moderate or vigorous).

Value is one of the following:

- `0`
- `1`

<br />

### endTime

Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

```
open val endTime: Instant
```

End time of the record.

### endZoneOffset

Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

```
open val endZoneOffset: ZoneOffset?
```

User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/IntervalRecord#endTime()`, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent.

### metadata

```
open val metadata: Metadata
```

Set of common metadata associated with the written record.

### startTime

Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

```
open val startTime: Instant
```

Start time of the record.

### startZoneOffset

Added in [1.2.0-alpha06](https://developer.android.com/jetpack/androidx/releases/health-connect#1.2.0-alpha06)

```
open val startZoneOffset: ZoneOffset?
```

User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/IntervalRecord#startTime()`, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent.