# BatteryManager

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/os/BatteryManager#constants)\|[Methods](https://developer.android.com/reference/android/os/BatteryManager#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/os/BatteryManager#inhmethods)  

# BatteryManager

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/os/BatteryManager "View this page in Kotlin")\|Java

`
public


class
BatteryManager
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|---------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.os.BatteryManager |

<br />

*** ** * ** ***

The BatteryManager class contains strings and constants used for values in the[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED)Intent, and provides a method for querying battery and charging properties.

## Summary

|                                                                                                                                                                                                                                                                     ### Constants                                                                                                                                                                                                                                                                     ||
|--------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_CHARGING](https://developer.android.com/reference/android/os/BatteryManager#ACTION_CHARGING) Sent when the device's battery has started charging (or has reached full charge and the device is on power).                                                                                                                                                                                                                                                                 |
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_DISCHARGING](https://developer.android.com/reference/android/os/BatteryManager#ACTION_DISCHARGING) Sent when the device's battery may be discharging, so apps should avoid doing extraneous work that would cause it to discharge faster.                                                                                                                                                                                                                                 |
| `int`                                                              | [BATTERY_CAPACITY_LEVEL_CRITICAL](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_CRITICAL) Battery capacity level is critical.                                                                                                                                                                                                                                                                                                          |
| `int`                                                              | [BATTERY_CAPACITY_LEVEL_FULL](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_FULL) Battery capacity level is full.                                                                                                                                                                                                                                                                                                                      |
| `int`                                                              | [BATTERY_CAPACITY_LEVEL_HIGH](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_HIGH) Battery capacity level is high.                                                                                                                                                                                                                                                                                                                      |
| `int`                                                              | [BATTERY_CAPACITY_LEVEL_LOW](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_LOW) Battery capacity level is low.                                                                                                                                                                                                                                                                                                                         |
| `int`                                                              | [BATTERY_CAPACITY_LEVEL_NORMAL](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_NORMAL) Battery capacity level is normal.                                                                                                                                                                                                                                                                                                                |
| `int`                                                              | [BATTERY_CAPACITY_LEVEL_UNKNOWN](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_UNKNOWN) Battery capacity level is unknown.                                                                                                                                                                                                                                                                                                             |
| `int`                                                              | [BATTERY_CAPACITY_LEVEL_UNSUPPORTED](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_UNSUPPORTED) Battery capacity level is unsupported.                                                                                                                                                                                                                                                                                                 |
| `int`                                                              | [BATTERY_HEALTH_COLD](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_COLD) <br />                                                                                                                                                                                                                                                                                                                                                               |
| `int`                                                              | [BATTERY_HEALTH_DEAD](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_DEAD) <br />                                                                                                                                                                                                                                                                                                                                                               |
| `int`                                                              | [BATTERY_HEALTH_GOOD](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_GOOD) <br />                                                                                                                                                                                                                                                                                                                                                               |
| `int`                                                              | [BATTERY_HEALTH_OVERHEAT](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_OVERHEAT) <br />                                                                                                                                                                                                                                                                                                                                                       |
| `int`                                                              | [BATTERY_HEALTH_OVER_VOLTAGE](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_OVER_VOLTAGE) <br />                                                                                                                                                                                                                                                                                                                                               |
| `int`                                                              | [BATTERY_HEALTH_UNKNOWN](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_UNKNOWN) <br />                                                                                                                                                                                                                                                                                                                                                         |
| `int`                                                              | [BATTERY_HEALTH_UNSPECIFIED_FAILURE](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_UNSPECIFIED_FAILURE) <br />                                                                                                                                                                                                                                                                                                                                 |
| `int`                                                              | [BATTERY_PLUGGED_AC](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_PLUGGED_AC) Power source is an AC charger.                                                                                                                                                                                                                                                                                                                                         |
| `int`                                                              | [BATTERY_PLUGGED_DOCK](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_PLUGGED_DOCK) Power source is dock.                                                                                                                                                                                                                                                                                                                                              |
| `int`                                                              | [BATTERY_PLUGGED_USB](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_PLUGGED_USB) Power source is a USB port.                                                                                                                                                                                                                                                                                                                                          |
| `int`                                                              | [BATTERY_PLUGGED_WIRELESS](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_PLUGGED_WIRELESS) Power source is wireless.                                                                                                                                                                                                                                                                                                                                  |
| `int`                                                              | [BATTERY_PROPERTY_CAPACITY](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_PROPERTY_CAPACITY) Remaining battery capacity as an integer percentage of total capacity (with no fractional part).                                                                                                                                                                                                                                                         |
| `int`                                                              | [BATTERY_PROPERTY_CHARGE_COUNTER](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_PROPERTY_CHARGE_COUNTER) Battery capacity in microampere-hours, as an integer.                                                                                                                                                                                                                                                                                        |
| `int`                                                              | [BATTERY_PROPERTY_CURRENT_AVERAGE](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_PROPERTY_CURRENT_AVERAGE) Average battery current in microamperes, as an integer.                                                                                                                                                                                                                                                                                    |
| `int`                                                              | [BATTERY_PROPERTY_CURRENT_NOW](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_PROPERTY_CURRENT_NOW) Instantaneous battery current in microamperes, as an integer.                                                                                                                                                                                                                                                                                      |
| `int`                                                              | [BATTERY_PROPERTY_ENERGY_COUNTER](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_PROPERTY_ENERGY_COUNTER) Battery remaining energy in nanowatt-hours, as a long integer.                                                                                                                                                                                                                                                                               |
| `int`                                                              | [BATTERY_PROPERTY_STATUS](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_PROPERTY_STATUS) Battery charge status, from a BATTERY_STATUS_\* value.                                                                                                                                                                                                                                                                                                       |
| `int`                                                              | [BATTERY_STATUS_CHARGING](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_STATUS_CHARGING) <br />                                                                                                                                                                                                                                                                                                                                                       |
| `int`                                                              | [BATTERY_STATUS_DISCHARGING](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_STATUS_DISCHARGING) <br />                                                                                                                                                                                                                                                                                                                                                 |
| `int`                                                              | [BATTERY_STATUS_FULL](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_STATUS_FULL) <br />                                                                                                                                                                                                                                                                                                                                                               |
| `int`                                                              | [BATTERY_STATUS_NOT_CHARGING](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_STATUS_NOT_CHARGING) <br />                                                                                                                                                                                                                                                                                                                                               |
| `int`                                                              | [BATTERY_STATUS_UNKNOWN](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_STATUS_UNKNOWN) <br />                                                                                                                                                                                                                                                                                                                                                         |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_BATTERY_LOW](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_BATTERY_LOW) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): Boolean field indicating whether the battery is currently considered to be low, that is whether a[Intent.ACTION_BATTERY_LOW](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_LOW)broadcast has been sent. |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_CAPACITY_LEVEL](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_CAPACITY_LEVEL) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): Int value representing the battery's capacity level.                                                                                                                                                                              |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_CHARGING_STATUS](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_CHARGING_STATUS) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): Int value representing the battery charging status.                                                                                                                                                                             |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_CYCLE_COUNT](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_CYCLE_COUNT) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): Int value representing the battery charging cycle count.                                                                                                                                                                                |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_HEALTH](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_HEALTH) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer containing the current health constant.                                                                                                                                                                                                   |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_ICON_SMALL](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_ICON_SMALL) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer containing the resource ID of a small status bar icon indicating the current battery state.                                                                                                                                       |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_LEVEL](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_LEVEL) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer field containing the current battery level, from 0 to[EXTRA_SCALE](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_SCALE).                                                                                          |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_PLUGGED](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_PLUGGED) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer indicating whether the device is plugged in to a power source; 0 means it is on battery, other constants are different types of power sources.                                                                                          |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_PRESENT](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_PRESENT) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): boolean indicating whether a battery is present.                                                                                                                                                                                                |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_SCALE](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_SCALE) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer containing the maximum battery level.                                                                                                                                                                                                       |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_STATUS](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_STATUS) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer containing the current status constant.                                                                                                                                                                                                   |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_TECHNOLOGY](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_TECHNOLOGY) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): String describing the technology of the current battery.                                                                                                                                                                                  |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_TEMPERATURE](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_TEMPERATURE) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer containing the current battery temperature.                                                                                                                                                                                     |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_VOLTAGE](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_VOLTAGE) Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer containing the current battery voltage level.                                                                                                                                                                                           |

|                                                                                                                                                              ### Public methods                                                                                                                                                              ||
|-----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` long`                                                               | ` `[computeChargeTimeRemaining](https://developer.android.com/reference/android/os/BatteryManager#computeChargeTimeRemaining())`() ` Compute an approximation for how much time (in milliseconds) remains until the battery is fully charged.                         |
| ` int`                                                                | ` `[getIntProperty](https://developer.android.com/reference/android/os/BatteryManager#getIntProperty(int))`(int id) ` Return the value of a battery property of integer type.                                                                                         |
| ` long`                                                               | ` `[getLongProperty](https://developer.android.com/reference/android/os/BatteryManager#getLongProperty(int))`(int id) ` Return the value of a battery property of long type If the platform does not provide the property queried, this value will be Long.MIN_VALUE. |
| ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[getStringProperty](https://developer.android.com/reference/android/os/BatteryManager#getStringProperty(int))`(int id) ` Return the value of a battery property of String type.                                                                                    |
| ` boolean`                                                            | ` `[isCharging](https://developer.android.com/reference/android/os/BatteryManager#isCharging())`() ` Return true if the battery is currently considered to be charging.                                                                                               |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### ACTION_CHARGING

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String ACTION_CHARGING
```

Sent when the device's battery has started charging (or has reached full charge and the device is on power). This is a good time to do work that you would like to avoid doing while on battery (that is to avoid draining the user's battery due to things they don't care enough about). This is paired with[ACTION_DISCHARGING](https://developer.android.com/reference/android/os/BatteryManager#ACTION_DISCHARGING). The current state can always be retrieved with[isCharging()](https://developer.android.com/reference/android/os/BatteryManager#isCharging()).

<br />

Constant Value: "android.os.action.CHARGING"  

### ACTION_DISCHARGING

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String ACTION_DISCHARGING
```

Sent when the device's battery may be discharging, so apps should avoid doing extraneous work that would cause it to discharge faster. This is paired with[ACTION_CHARGING](https://developer.android.com/reference/android/os/BatteryManager#ACTION_CHARGING). The current state can always be retrieved with[isCharging()](https://developer.android.com/reference/android/os/BatteryManager#isCharging()).

<br />

Constant Value: "android.os.action.DISCHARGING"  

### BATTERY_CAPACITY_LEVEL_CRITICAL

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_CAPACITY_LEVEL_CRITICAL
```

Battery capacity level is critical. The Android framework has been notified to schedule a shutdown by this value.

<br />

**See also:**

- [EXTRA_CAPACITY_LEVEL](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_CAPACITY_LEVEL)

Constant Value: 1 (0x00000001)  

### BATTERY_CAPACITY_LEVEL_FULL

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_CAPACITY_LEVEL_FULL
```

Battery capacity level is full. The battery is full, the battery temperature is within the normal range, and adapter power is enough to sustain running background loads. The Android framework can run background tasks without affecting the battery level or battery performance.

<br />

**See also:**

- [EXTRA_CAPACITY_LEVEL](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_CAPACITY_LEVEL)

Constant Value: 5 (0x00000005)  

### BATTERY_CAPACITY_LEVEL_HIGH

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_CAPACITY_LEVEL_HIGH
```

Battery capacity level is high. Battery level is high, battery temperature is within the normal range, and adapter power is enough to charge the battery at an acceptable rate while running background loads. The Android framework can run background tasks without affecting charging or battery performance.

<br />

**See also:**

- [EXTRA_CAPACITY_LEVEL](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_CAPACITY_LEVEL)

Constant Value: 4 (0x00000004)  

### BATTERY_CAPACITY_LEVEL_LOW

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_CAPACITY_LEVEL_LOW
```

Battery capacity level is low. The Android framework must limit background jobs to avoid impacting charging speed.

<br />

**See also:**

- [EXTRA_CAPACITY_LEVEL](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_CAPACITY_LEVEL)

Constant Value: 2 (0x00000002)  

### BATTERY_CAPACITY_LEVEL_NORMAL

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_CAPACITY_LEVEL_NORMAL
```

Battery capacity level is normal. Battery level and charging rates are normal, battery temperature is within the normal range, and adapter power is enough to charge the battery at an acceptable rate. The Android framework can run light background tasks without affecting charging performance severely.

<br />

**See also:**

- [EXTRA_CAPACITY_LEVEL](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_CAPACITY_LEVEL)

Constant Value: 3 (0x00000003)  

### BATTERY_CAPACITY_LEVEL_UNKNOWN

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_CAPACITY_LEVEL_UNKNOWN
```

Battery capacity level is unknown.

<br />

**See also:**

- [EXTRA_CAPACITY_LEVEL](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_CAPACITY_LEVEL)

Constant Value: 0 (0x00000000)  

### BATTERY_CAPACITY_LEVEL_UNSUPPORTED

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_CAPACITY_LEVEL_UNSUPPORTED
```

Battery capacity level is unsupported.

<br />

**See also:**

- [EXTRA_CAPACITY_LEVEL](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_CAPACITY_LEVEL)

Constant Value: -1 (0xffffffff)  

### BATTERY_HEALTH_COLD

Added in[API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_HEALTH_COLD
```

<br />

<br />

Constant Value: 7 (0x00000007)  

### BATTERY_HEALTH_DEAD

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_HEALTH_DEAD
```

<br />

<br />

Constant Value: 4 (0x00000004)  

### BATTERY_HEALTH_GOOD

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_HEALTH_GOOD
```

<br />

<br />

Constant Value: 2 (0x00000002)  

### BATTERY_HEALTH_OVERHEAT

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_HEALTH_OVERHEAT
```

<br />

<br />

Constant Value: 3 (0x00000003)  

### BATTERY_HEALTH_OVER_VOLTAGE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_HEALTH_OVER_VOLTAGE
```

<br />

<br />

Constant Value: 5 (0x00000005)  

### BATTERY_HEALTH_UNKNOWN

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_HEALTH_UNKNOWN
```

<br />

<br />

Constant Value: 1 (0x00000001)  

### BATTERY_HEALTH_UNSPECIFIED_FAILURE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_HEALTH_UNSPECIFIED_FAILURE
```

<br />

<br />

Constant Value: 6 (0x00000006)  

### BATTERY_PLUGGED_AC

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_PLUGGED_AC
```

Power source is an AC charger.

<br />

Constant Value: 1 (0x00000001)  

### BATTERY_PLUGGED_DOCK

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_PLUGGED_DOCK
```

Power source is dock.

<br />

Constant Value: 8 (0x00000008)  

### BATTERY_PLUGGED_USB

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_PLUGGED_USB
```

Power source is a USB port.

<br />

Constant Value: 2 (0x00000002)  

### BATTERY_PLUGGED_WIRELESS

Added in[API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_PLUGGED_WIRELESS
```

Power source is wireless.

<br />

Constant Value: 4 (0x00000004)  

### BATTERY_PROPERTY_CAPACITY

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_PROPERTY_CAPACITY
```

Remaining battery capacity as an integer percentage of total capacity (with no fractional part).

<br />

Constant Value: 4 (0x00000004)  

### BATTERY_PROPERTY_CHARGE_COUNTER

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_PROPERTY_CHARGE_COUNTER
```

Battery capacity in microampere-hours, as an integer.

<br />

Constant Value: 1 (0x00000001)  

### BATTERY_PROPERTY_CURRENT_AVERAGE

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_PROPERTY_CURRENT_AVERAGE
```

Average battery current in microamperes, as an integer. Positive values indicate net current entering the battery from a charge source, negative values indicate net current discharging from the battery. The time period over which the average is computed may depend on the fuel gauge hardware and its configuration.

<br />

Constant Value: 3 (0x00000003)  

### BATTERY_PROPERTY_CURRENT_NOW

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_PROPERTY_CURRENT_NOW
```

Instantaneous battery current in microamperes, as an integer. Positive values indicate net current entering the battery from a charge source, negative values indicate net current discharging from the battery.

<br />

Constant Value: 2 (0x00000002)  

### BATTERY_PROPERTY_ENERGY_COUNTER

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_PROPERTY_ENERGY_COUNTER
```

Battery remaining energy in nanowatt-hours, as a long integer.

<br />

Constant Value: 5 (0x00000005)  

### BATTERY_PROPERTY_STATUS

Added in[API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_PROPERTY_STATUS
```

Battery charge status, from a BATTERY_STATUS_\* value.

<br />

Constant Value: 6 (0x00000006)  

### BATTERY_STATUS_CHARGING

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_STATUS_CHARGING
```

<br />

<br />

Constant Value: 2 (0x00000002)  

### BATTERY_STATUS_DISCHARGING

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_STATUS_DISCHARGING
```

<br />

<br />

Constant Value: 3 (0x00000003)  

### BATTERY_STATUS_FULL

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_STATUS_FULL
```

<br />

<br />

Constant Value: 5 (0x00000005)  

### BATTERY_STATUS_NOT_CHARGING

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_STATUS_NOT_CHARGING
```

<br />

<br />

Constant Value: 4 (0x00000004)  

### BATTERY_STATUS_UNKNOWN

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int BATTERY_STATUS_UNKNOWN
```

<br />

<br />

Constant Value: 1 (0x00000001)  

### EXTRA_BATTERY_LOW

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_BATTERY_LOW
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): Boolean field indicating whether the battery is currently considered to be low, that is whether a[Intent.ACTION_BATTERY_LOW](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_LOW)broadcast has been sent.

<br />

Constant Value: "battery_low"  

### EXTRA_CAPACITY_LEVEL

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_CAPACITY_LEVEL
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): Int value representing the battery's capacity level. These constants are key indicators of battery status and system capabilities, guiding power management decisions for both the system and apps.

<br />

**See also:**

- [BATTERY_CAPACITY_LEVEL_UNSUPPORTED](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_UNSUPPORTED)
- [BATTERY_CAPACITY_LEVEL_UNKNOWN](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_UNKNOWN)
- [BATTERY_CAPACITY_LEVEL_CRITICAL](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_CRITICAL)
- [BATTERY_CAPACITY_LEVEL_LOW](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_LOW)
- [BATTERY_CAPACITY_LEVEL_NORMAL](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_NORMAL)
- [BATTERY_CAPACITY_LEVEL_HIGH](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_HIGH)
- [BATTERY_CAPACITY_LEVEL_FULL](https://developer.android.com/reference/android/os/BatteryManager#BATTERY_CAPACITY_LEVEL_FULL)

Constant Value: "android.os.extra.CAPACITY_LEVEL"  

### EXTRA_CHARGING_STATUS

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_CHARGING_STATUS
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): Int value representing the battery charging status.

<br />

Constant Value: "android.os.extra.CHARGING_STATUS"  

### EXTRA_CYCLE_COUNT

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_CYCLE_COUNT
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): Int value representing the battery charging cycle count.

<br />

Constant Value: "android.os.extra.CYCLE_COUNT"  

### EXTRA_HEALTH

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_HEALTH
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer containing the current health constant.

<br />

Constant Value: "health"  

### EXTRA_ICON_SMALL

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_ICON_SMALL
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer containing the resource ID of a small status bar icon indicating the current battery state.

<br />

Constant Value: "icon-small"  

### EXTRA_LEVEL

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_LEVEL
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer field containing the current battery level, from 0 to[EXTRA_SCALE](https://developer.android.com/reference/android/os/BatteryManager#EXTRA_SCALE).

<br />

Constant Value: "level"  

### EXTRA_PLUGGED

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_PLUGGED
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer indicating whether the device is plugged in to a power source; 0 means it is on battery, other constants are different types of power sources.

<br />

Constant Value: "plugged"  

### EXTRA_PRESENT

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_PRESENT
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): boolean indicating whether a battery is present.

<br />

Constant Value: "present"  

### EXTRA_SCALE

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_SCALE
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer containing the maximum battery level.

<br />

Constant Value: "scale"  

### EXTRA_STATUS

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_STATUS
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer containing the current status constant.

<br />

Constant Value: "status"  

### EXTRA_TECHNOLOGY

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_TECHNOLOGY
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): String describing the technology of the current battery.

<br />

Constant Value: "technology"  

### EXTRA_TEMPERATURE

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_TEMPERATURE
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer containing the current battery temperature.

<br />

Constant Value: "temperature"  

### EXTRA_VOLTAGE

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_VOLTAGE
```

Extra for[Intent.ACTION_BATTERY_CHANGED](https://developer.android.com/reference/android/content/Intent#ACTION_BATTERY_CHANGED): integer containing the current battery voltage level.

<br />

Constant Value: "voltage"

## Public methods

### computeChargeTimeRemaining

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public long computeChargeTimeRemaining ()
```

Compute an approximation for how much time (in milliseconds) remains until the battery is fully charged. Returns -1 if no time can be computed: either there is not enough current data to make a decision or the battery is currently discharging.

<br />

|                                                         Returns                                                          ||
|--------|------------------------------------------------------------------------------------------------------------------|
| `long` | how much time is left, in milliseconds, until the battery is fully charged or -1 if the computation fails <br /> |

### getIntProperty

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getIntProperty (int id)
```

Return the value of a battery property of integer type.

<br />

|                        Parameters                        ||
|------|----------------------------------------------------|
| `id` | `int`: identifier of the requested property <br /> |

|                                                                                                       Returns                                                                                                        ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | the property value. If the property is not supported or there is any other error, return (a) 0 if`targetSdkVersion < VERSION_CODES.P`or (b) Integer.MIN_VALUE if`targetSdkVersion >= VERSION_CODES.P`. <br /> |

### getLongProperty

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public long getLongProperty (int id)
```

Return the value of a battery property of long type If the platform does not provide the property queried, this value will be Long.MIN_VALUE.

<br />

|                        Parameters                        ||
|------|----------------------------------------------------|
| `id` | `int`: identifier of the requested property <br /> |

|                                Returns                                 ||
|--------|----------------------------------------------------------------|
| `long` | the property value, or Long.MIN_VALUE if not supported. <br /> |

### getStringProperty

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public String getStringProperty (int id)
```

Return the value of a battery property of String type. If the platform does not provide the property queried, this value will be null.

<br />

|                        Parameters                         ||
|------|-----------------------------------------------------|
| `id` | `int`: identifier of the requested property. <br /> |

|                                                         Returns                                                          ||
|--------------------------------------------------------------------|------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the property value, or null if not supported. <br /> |

### isCharging

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isCharging ()
```

Return true if the battery is currently considered to be charging. This means that the device is plugged in and is supplying sufficient power that the battery level is going up (or the battery is fully charged). Changes in this state are matched by broadcasts of[ACTION_CHARGING](https://developer.android.com/reference/android/os/BatteryManager#ACTION_CHARGING)and[ACTION_DISCHARGING](https://developer.android.com/reference/android/os/BatteryManager#ACTION_DISCHARGING).

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |