# BatteryState

Artifact: [androidx.xr.projected:projected](https://developer.android.com/jetpack/androidx/releases/xr-projected) [View Source](https://cs.android.com/search?q=file:androidx/xr/projected/BatteryState.kt+class:androidx.xr.projected.BatteryState) Added in [1.0.0-alpha14](https://developer.android.com/jetpack/androidx/releases/xr-projected#1.0.0-alpha14)

*** ** * ** ***


```
class BatteryState
```

<br />

*** ** * ** ***

Information about the battery state of the projected device.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/projected/BatteryState#BatteryState(kotlin.Boolean,kotlin.Int)( isCharging: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, batteryLevel: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0, to = 100) 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/xr/projected/BatteryState#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/xr/projected/BatteryState#hashCode()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/projected/BatteryState#batteryLevel()` the current battery level, from 0 to 100 inclusive |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/projected/BatteryState#isCharging()` true if the battery is currently charging, false otherwise |

## Public constructors

### BatteryState

Added in [1.0.0-alpha14](https://developer.android.com/jetpack/androidx/releases/xr-projected#1.0.0-alpha14)

```
BatteryState(
    isCharging: Boolean,
    batteryLevel: @IntRange(from = 0, to = 100) Int
)
```

## Public functions

### equals

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

### hashCode

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

## Public properties

### batteryLevel

Added in [1.0.0-alpha14](https://developer.android.com/jetpack/androidx/releases/xr-projected#1.0.0-alpha14)

```
val batteryLevel: Int
```

the current battery level, from 0 to 100 inclusive

### isCharging

Added in [1.0.0-alpha14](https://developer.android.com/jetpack/androidx/releases/xr-projected#1.0.0-alpha14)

```
val isCharging: Boolean
```

true if the battery is currently charging, false otherwise