# HeartRateRecord

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/HeartRateRecord.kt+class:androidx.health.connect.client.records.HeartRateRecord) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/health/connect/client/records/HeartRateRecord "View this page in Java")


```
class HeartRateRecord : Record
```

<br />

*** ** * ** ***

Captures the user's heart rate. Each record represents a series of measurements.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/HeartRateRecord.Sample` Represents a single measurement of the heart rate. |

| ### Public companion properties |
|---|---|
| `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/HeartRateRecord#BPM_AVG()` Metric identifier to retrieve the average heart rate 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/HeartRateRecord#BPM_MAX()` Metric identifier to retrieve the maximum heart rate 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/HeartRateRecord#BPM_MIN()` Metric identifier to retrieve the minimum heart rate 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/HeartRateRecord#MEASUREMENTS_COUNT()` Metric identifier to retrieve the number of heart rate measurements 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/HeartRateRecord#HeartRateRecord(java.time.Instant,java.time.ZoneOffset,java.time.Instant,java.time.ZoneOffset,kotlin.collections.List,androidx.health.connect.client.records.metadata.Metadata)( 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?, samples: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/HeartRateRecord.Sample>, metadata: https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata )` |

| ### 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/HeartRateRecord#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/HeartRateRecord#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/HeartRateRecord#toString()()` |

| ### Public properties |
|---|---|
| `open https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/HeartRateRecord#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/HeartRateRecord#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/HeartRateRecord#metadata()` Set of common metadata associated with the written record. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/HeartRateRecord.Sample>` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/HeartRateRecord#samples()` |
| `open https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/HeartRateRecord#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/HeartRateRecord#startZoneOffset()` User experienced zone offset at `https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/IntervalRecord#startTime()`, or null if unknown. |

## Public companion properties

### BPM_AVG

```
val BPM_AVG: AggregateMetric<Long>
```

Metric identifier to retrieve the average heart rate from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`.

### BPM_MAX

```
val BPM_MAX: AggregateMetric<Long>
```

Metric identifier to retrieve the maximum heart rate from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`.

### BPM_MIN

```
val BPM_MIN: AggregateMetric<Long>
```

Metric identifier to retrieve the minimum heart rate from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`.

### MEASUREMENTS_COUNT

```
val MEASUREMENTS_COUNT: AggregateMetric<Long>
```

Metric identifier to retrieve the number of heart rate measurements from `https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult`.

## Public constructors

### HeartRateRecord

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

```
HeartRateRecord(
    startTime: Instant,
    startZoneOffset: ZoneOffset?,
    endTime: Instant,
    endZoneOffset: ZoneOffset?,
    samples: List<HeartRateRecord.Sample>,
    metadata: Metadata
)
```

## Public functions

### equals

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

### hashCode

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

### toString

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

## Public properties

### endTime

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

```
open val endTime: Instant
```

End time of the record.

### endZoneOffset

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

```
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.

### samples

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

```
open val samples: List<HeartRateRecord.Sample>
```

### startTime

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

```
open val startTime: Instant
```

Start time of the record.

### startZoneOffset

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

```
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.