# StepsRecord

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

*** ** * ** ***


```
public final class StepsRecord implements Record
```

<br />

*** ** * ** ***

Captures the number of steps taken since the last reading. Each step is only reported once so records shouldn't have overlapping time. The start time of each record should represent the start of the interval in which steps were taken.

The start time must be equal to or greater than the end time of the previous record. Adding all of the values together for a period of time calculates the total number of steps during that period.

## Summary

| ### 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/lang/Long.html>` | `https://developer.android.com/reference/androidx/health/connect/client/records/StepsRecord#COUNT_TOTAL()` Metric identifier to retrieve the total steps count from `https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/health/connect/client/records/StepsRecord#StepsRecord(java.time.Instant,java.time.ZoneOffset,java.time.Instant,java.time.ZoneOffset,kotlin.Long,androidx.health.connect.client.records.metadata.Metadata)( @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/IntRange(from = 1, to = 1000000) long count, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/connect/client/records/metadata/Metadata metadata )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/connect/client/records/StepsRecord#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final long` | `https://developer.android.com/reference/androidx/health/connect/client/records/StepsRecord#getCount()()` Count. |
| `@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/StepsRecord#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/StepsRecord#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/StepsRecord#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/StepsRecord#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/StepsRecord#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/StepsRecord#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/StepsRecord#toString()()` |

## Public fields

### COUNT_TOTAL

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

Metric identifier to retrieve the total steps count from `https://developer.android.com/reference/androidx/health/connect/client/aggregate/AggregationResult`.

## Public constructors

### StepsRecord

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

```
public StepsRecord(
    @NonNull Instant startTime,
    ZoneOffset startZoneOffset,
    @NonNull Instant endTime,
    ZoneOffset endZoneOffset,
    @IntRange(from = 1, to = 1000000) long count,
    @NonNull Metadata metadata
)
```

## Public methods

### equals

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

### getCount

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

```
public final long getCount()
```

Count. Required field. Valid range: 1-1000000.

### getEndTime

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

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

End time of the record.

### getEndZoneOffset

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

```
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.1.0](https://developer.android.com/jetpack/androidx/releases/health-connect#1.1.0)

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

Start time of the record.

### getStartZoneOffset

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

```
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()
```