public class

BatteryManager

extends Object
java.lang.Object
   ↳android.os.BatteryManager

Class Overview

The BatteryManager class contains strings and constants used for values in the ACTION_BATTERY_CHANGED Intent.

Summary

Constants
intBATTERY_HEALTH_DEAD
intBATTERY_HEALTH_GOOD
intBATTERY_HEALTH_OVERHEAT
intBATTERY_HEALTH_OVER_VOLTAGE
intBATTERY_HEALTH_UNKNOWN
intBATTERY_HEALTH_UNSPECIFIED_FAILURE
intBATTERY_PLUGGED_ACPower source is an AC charger.
intBATTERY_PLUGGED_USBPower source is a USB port.
intBATTERY_STATUS_CHARGING
intBATTERY_STATUS_DISCHARGING
intBATTERY_STATUS_FULL
intBATTERY_STATUS_NOT_CHARGING
intBATTERY_STATUS_UNKNOWN
StringEXTRA_HEALTHExtra for ACTION_BATTERY_CHANGED: integer containing the current health constant.
StringEXTRA_ICON_SMALLExtra for ACTION_BATTERY_CHANGED: integer containing the resource ID of a small status bar icon indicating the current battery state.
StringEXTRA_LEVELExtra for ACTION_BATTERY_CHANGED: integer field containing the current battery level, from 0 to EXTRA_SCALE.
StringEXTRA_PLUGGEDExtra for 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.
StringEXTRA_PRESENTExtra for ACTION_BATTERY_CHANGED: boolean indicating whether a battery is present.
StringEXTRA_SCALEExtra for ACTION_BATTERY_CHANGED: integer containing the maximum battery level.
StringEXTRA_STATUSExtra for ACTION_BATTERY_CHANGED: integer containing the current status constant.
StringEXTRA_TECHNOLOGYExtra for ACTION_BATTERY_CHANGED: String describing the technology of the current battery.
StringEXTRA_TEMPERATUREExtra for ACTION_BATTERY_CHANGED: integer containing the current battery temperature.
StringEXTRA_VOLTAGEExtra for ACTION_BATTERY_CHANGED: integer containing the current battery voltage level.
Public Constructors
BatteryManager()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int BATTERY_HEALTH_DEAD

Since: API Level 1

Constant Value: 4 (0x00000004)

public static final int BATTERY_HEALTH_GOOD

Since: API Level 1

Constant Value: 2 (0x00000002)

public static final int BATTERY_HEALTH_OVERHEAT

Since: API Level 1

Constant Value: 3 (0x00000003)

public static final int BATTERY_HEALTH_OVER_VOLTAGE

Since: API Level 1

Constant Value: 5 (0x00000005)

public static final int BATTERY_HEALTH_UNKNOWN

Since: API Level 1

Constant Value: 1 (0x00000001)

public static final int BATTERY_HEALTH_UNSPECIFIED_FAILURE

Since: API Level 1

Constant Value: 6 (0x00000006)

public static final int BATTERY_PLUGGED_AC

Since: API Level 1

Power source is an AC charger.

Constant Value: 1 (0x00000001)

public static final int BATTERY_PLUGGED_USB

Since: API Level 1

Power source is a USB port.

Constant Value: 2 (0x00000002)

public static final int BATTERY_STATUS_CHARGING

Since: API Level 1

Constant Value: 2 (0x00000002)

public static final int BATTERY_STATUS_DISCHARGING

Since: API Level 1

Constant Value: 3 (0x00000003)

public static final int BATTERY_STATUS_FULL

Since: API Level 1

Constant Value: 5 (0x00000005)

public static final int BATTERY_STATUS_NOT_CHARGING

Since: API Level 1

Constant Value: 4 (0x00000004)

public static final int BATTERY_STATUS_UNKNOWN

Since: API Level 1

Constant Value: 1 (0x00000001)

public static final String EXTRA_HEALTH

Since: API Level 5

Extra for ACTION_BATTERY_CHANGED: integer containing the current health constant.

Constant Value: "health"

public static final String EXTRA_ICON_SMALL

Since: API Level 5

Extra for ACTION_BATTERY_CHANGED: integer containing the resource ID of a small status bar icon indicating the current battery state.

Constant Value: "icon-small"

public static final String EXTRA_LEVEL

Since: API Level 5

Extra for ACTION_BATTERY_CHANGED: integer field containing the current battery level, from 0 to EXTRA_SCALE.

Constant Value: "level"

public static final String EXTRA_PLUGGED

Since: API Level 5

Extra for 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.

Constant Value: "plugged"

public static final String EXTRA_PRESENT

Since: API Level 5

Extra for ACTION_BATTERY_CHANGED: boolean indicating whether a battery is present.

Constant Value: "present"

public static final String EXTRA_SCALE

Since: API Level 5

Extra for ACTION_BATTERY_CHANGED: integer containing the maximum battery level.

Constant Value: "scale"

public static final String EXTRA_STATUS

Since: API Level 5

Extra for ACTION_BATTERY_CHANGED: integer containing the current status constant.

Constant Value: "status"

public static final String EXTRA_TECHNOLOGY

Since: API Level 5

Extra for ACTION_BATTERY_CHANGED: String describing the technology of the current battery.

Constant Value: "technology"

public static final String EXTRA_TEMPERATURE

Since: API Level 5

Extra for ACTION_BATTERY_CHANGED: integer containing the current battery temperature.

Constant Value: "temperature"

public static final String EXTRA_VOLTAGE

Since: API Level 5

Extra for ACTION_BATTERY_CHANGED: integer containing the current battery voltage level.

Constant Value: "voltage"

Public Constructors

public BatteryManager ()

Since: API Level 1