# PowerRecord

# PowerRecord

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/PowerRecord.kt+class:androidx.health.connect.client.records.PowerRecord)  
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/PowerRecord "View this page in Java")


```
class PowerRecord : Record
```

<br />

*** ** * ** ***

Captures the power generated by the user, e.g. during cycling or rowing with a power meter. Each record represents a series of measurements.

## Summary

|                                                                                 ### Nested types                                                                                 |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[PowerRecord.Sample](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord.Sample) Represents a single measurement of power. |

|                                                                                                  ### Public companion properties                                                                                                   |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AggregateMetric](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric)`<`[Power](https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Power)`>` | [POWER_AVG](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#POWER_AVG()) Metric identifier to retrieve average power from [androidx.health.connect.client.aggregate.AggregationResult](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult). |
| [AggregateMetric](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric)`<`[Power](https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Power)`>` | [POWER_MAX](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#POWER_MAX()) Metric identifier to retrieve maximum power from [androidx.health.connect.client.aggregate.AggregationResult](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult). |
| [AggregateMetric](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregateMetric)`<`[Power](https://developer.android.com/reference/kotlin/androidx/health/connect/client/units/Power)`>` | [POWER_MIN](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#POWER_MIN()) Metric identifier to retrieve minimum power from [androidx.health.connect.client.aggregate.AggregationResult](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult). |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [PowerRecord](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#PowerRecord(java.time.Instant,java.time.ZoneOffset,java.time.Instant,java.time.ZoneOffset,kotlin.collections.List,androidx.health.connect.client.records.metadata.Metadata))`(` ` startTime: `[Instant](https://developer.android.com/reference/java/time/Instant.html)`,` ` startZoneOffset: `[ZoneOffset](https://developer.android.com/reference/java/time/ZoneOffset.html)`?,` ` endTime: `[Instant](https://developer.android.com/reference/java/time/Instant.html)`,` ` endZoneOffset: `[ZoneOffset](https://developer.android.com/reference/java/time/ZoneOffset.html)`?,` ` samples: `[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[PowerRecord.Sample](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord.Sample)`>,` ` metadata: `[Metadata](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata) `)` |

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

|                                                                                                        ### Public properties                                                                                                         |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open `[Instant](https://developer.android.com/reference/java/time/Instant.html)                                                                                                                                                     | [endTime](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#endTime()) End time of the record.                                                                                                                                                                         |
| `open `[ZoneOffset](https://developer.android.com/reference/java/time/ZoneOffset.html)`?`                                                                                                                                            | [endZoneOffset](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#endZoneOffset()) User experienced zone offset at [endTime](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#endTime()), or null if unknown.         |
| `open `[Metadata](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/metadata/Metadata)                                                                                                           | [metadata](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#metadata()) Set of common metadata associated with the written record.                                                                                                                                    |
| `open `[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[PowerRecord.Sample](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord.Sample)`>` | [samples](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#samples())                                                                                                                                                                                                 |
| `open `[Instant](https://developer.android.com/reference/java/time/Instant.html)                                                                                                                                                     | [startTime](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#startTime()) Start time of the record.                                                                                                                                                                   |
| `open `[ZoneOffset](https://developer.android.com/reference/java/time/ZoneOffset.html)`?`                                                                                                                                            | [startZoneOffset](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#startZoneOffset()) User experienced zone offset at [startTime](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#startTime()), or null if unknown. |

## Public companion properties

### POWER_AVG

```
val POWER_AVG: AggregateMetric<Power>
```

Metric identifier to retrieve average power from [androidx.health.connect.client.aggregate.AggregationResult](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult).  

### POWER_MAX

```
val POWER_MAX: AggregateMetric<Power>
```

Metric identifier to retrieve maximum power from [androidx.health.connect.client.aggregate.AggregationResult](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult).  

### POWER_MIN

```
val POWER_MIN: AggregateMetric<Power>
```

Metric identifier to retrieve minimum power from [androidx.health.connect.client.aggregate.AggregationResult](https://developer.android.com/reference/kotlin/androidx/health/connect/client/aggregate/AggregationResult).  

## Public constructors

### PowerRecord

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

```
PowerRecord(
    startTime: Instant,
    startZoneOffset: ZoneOffset?,
    endTime: Instant,
    endZoneOffset: ZoneOffset?,
    samples: List<PowerRecord.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 [endTime](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#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<PowerRecord.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 [startTime](https://developer.android.com/reference/kotlin/androidx/health/connect/client/records/PowerRecord#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.