# 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)

*** ** * ** ***


```
public final class ActivityIntensityRecord implements 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/androidx/health/connect/client/HealthConnectFeatures#getFeatureStatus(kotlin.Int)` and pass `https://developer.android.com/reference/androidx/health/connect/client/HealthConnectFeatures#FEATURE_ACTIVITY_INTENSITY()` as an argument.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/ActivityIntensityRecord#ACTIVITY_INTENSITY_TYPE_MODERATE() = 0` Moderate intensity activity |
| `static final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/ActivityIntensityRecord#ACTIVITY_INTENSITY_TYPE_VIGOROUS() = 1` Vigorous intensity activity. |

| ### Public fields |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregateMetric<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html>` | `https://developer.android.com/reference/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/androidx/health/connect/client/aggregate/AggregationResult`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregateMetric<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html>` | `https://developer.android.com/reference/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/androidx/health/connect/client/aggregate/AggregationResult`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregateMetric<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html>` | `https://developer.android.com/reference/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/androidx/health/connect/client/aggregate/AggregationResult`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregateMetric<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html>` | `https://developer.android.com/reference/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/androidx/health/connect/client/aggregate/AggregationResult`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/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)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html startTime, https://developer.android.com/reference/java/time/ZoneOffset.html startZoneOffset, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html endTime, https://developer.android.com/reference/java/time/ZoneOffset.html endZoneOffset, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata metadata, int activityIntensityType )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/connect/client/records/ActivityIntensityRecord#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final int` | `https://developer.android.com/reference/androidx/health/connect/client/records/ActivityIntensityRecord#getActivityIntensityType()()` Type of activity intensity (moderate or vigorous). |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/ActivityIntensityRecord#getEndTime()()` End time of the record. |
| `https://developer.android.com/reference/java/time/ZoneOffset.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/ActivityIntensityRecord#getEndZoneOffset()()` User experienced zone offset at `https://developer.android.com/reference/androidx/health/connect/client/records/IntervalRecord#endTime()`, or null if unknown. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata` | `https://developer.android.com/reference/androidx/health/connect/client/records/ActivityIntensityRecord#getMetadata()()` Set of common metadata associated with the written record. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/ActivityIntensityRecord#getStartTime()()` Start time of the record. |
| `https://developer.android.com/reference/java/time/ZoneOffset.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/ActivityIntensityRecord#getStartZoneOffset()()` User experienced zone offset at `https://developer.android.com/reference/androidx/health/connect/client/records/IntervalRecord#startTime()`, or null if unknown. |
| `int` | `https://developer.android.com/reference/androidx/health/connect/client/records/ActivityIntensityRecord#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/connect/client/records/ActivityIntensityRecord#toString()()` |

## Constants

### ACTIVITY_INTENSITY_TYPE_MODERATE

```
public static final int ACTIVITY_INTENSITY_TYPE_MODERATE = 0
```

Moderate intensity activity

### ACTIVITY_INTENSITY_TYPE_VIGOROUS

```
public static final int ACTIVITY_INTENSITY_TYPE_VIGOROUS = 1
```

Vigorous intensity activity.

## Public fields

### DURATION_TOTAL

```
public static final @NonNull AggregateMetric<@NonNull Duration> DURATION_TOTAL
```

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

### INTENSITY_MINUTES_TOTAL

```
public static final @NonNull AggregateMetric<@NonNull Long> INTENSITY_MINUTES_TOTAL
```

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

### MODERATE_DURATION_TOTAL

```
public static final @NonNull AggregateMetric<@NonNull Duration> MODERATE_DURATION_TOTAL
```

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

### VIGOROUS_DURATION_TOTAL

```
public static final @NonNull AggregateMetric<@NonNull Duration> VIGOROUS_DURATION_TOTAL
```

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

```
public ActivityIntensityRecord(
    @NonNull Instant startTime,
    ZoneOffset startZoneOffset,
    @NonNull Instant endTime,
    ZoneOffset endZoneOffset,
    @NonNull Metadata metadata,
    int activityIntensityType
)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getActivityIntensityType

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

```
public final int getActivityIntensityType()
```

Type of activity intensity (moderate or vigorous).

### getEndTime

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

```
public @NonNull Instant getEndTime()
```

End time of the record.

### getEndZoneOffset

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

```
public ZoneOffset getEndZoneOffset()
```

User experienced zone offset at `https://developer.android.com/reference/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.

### getMetadata

```
public @NonNull Metadata getMetadata()
```

Set of common metadata associated with the written record.

### getStartTime

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

```
public @NonNull Instant getStartTime()
```

Start time of the record.

### getStartZoneOffset

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

```
public ZoneOffset getStartZoneOffset()
```

User experienced zone offset at `https://developer.android.com/reference/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.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```