BatteryManager class

This class provides a method for querying battery and charging properties.

See: https://developer.android.com/reference/android/os/BatteryManager

Constructors

BatteryManager()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Constants

ACTION_CHARGING → const String
Sent when the device's battery has started charging (or has reached full charge and the device is on power). [...]
"android.os.action.CHARGING"
ACTION_DISCHARGING → const String
Sent when the device's battery may be discharging, so apps should avoid doing extraneous work that would cause it to discharge faster. [...]
"android.os.action.DISCHARGING"
BATTERY_HEALTH_COLD → const int
See: https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_COLD
7
BATTERY_HEALTH_DEAD → const int
See: https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_DEAD
4
BATTERY_HEALTH_GOOD → const int
See: https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_GOOD
2
BATTERY_HEALTH_OVER_VOLTAGE → const int
See: https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_OVER_VOLTAGE
5
BATTERY_HEALTH_OVERHEAT → const int
See: https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_OVERHEAT
3
BATTERY_HEALTH_UNKNOWN → const int
See: https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_UNKNOWN
1
BATTERY_HEALTH_UNSPECIFIED_FAILURE → const int
See: https://developer.android.com/reference/android/os/BatteryManager#BATTERY_HEALTH_UNSPECIFIED_FAILURE
6
BATTERY_PLUGGED_AC → const int
Power source is an AC charger. [...]
1
BATTERY_PLUGGED_USB → const int
Power source is a USB port. [...]
2
BATTERY_PLUGGED_WIRELESS → const int
Power source is wireless. [...]
4
BATTERY_PROPERTY_CAPACITY → const int
Remaining battery capacity as an integer percentage of total capacity (with no fractional part). [...]
4
BATTERY_PROPERTY_CHARGE_COUNTER → const int
Battery capacity in microampere-hours, as an integer. [...]
1
BATTERY_PROPERTY_CURRENT_AVERAGE → const int
Average battery current in microamperes, as an integer. [...]
3
BATTERY_PROPERTY_CURRENT_NOW → const int
Instantaneous battery current in microamperes, as an integer. [...]
2
BATTERY_PROPERTY_ENERGY_COUNTER → const int
Battery remaining energy in nanowatt-hours, as a long integer. [...]
5
BATTERY_PROPERTY_STATUS → const int
Battery charge status, from a BATTERY_STATUS_* value. [...]
6
BATTERY_STATUS_CHARGING → const int
See: https://developer.android.com/reference/android/os/BatteryManager#BATTERY_STATUS_CHARGING
2
BATTERY_STATUS_DISCHARGING → const int
See: https://developer.android.com/reference/android/os/BatteryManager#BATTERY_STATUS_DISCHARGING
3
BATTERY_STATUS_FULL → const int
See: https://developer.android.com/reference/android/os/BatteryManager#BATTERY_STATUS_FULL
5
BATTERY_STATUS_NOT_CHARGING → const int
See: https://developer.android.com/reference/android/os/BatteryManager#BATTERY_STATUS_NOT_CHARGING
4
BATTERY_STATUS_UNKNOWN → const int
See: https://developer.android.com/reference/android/os/BatteryManager#BATTERY_STATUS_UNKNOWN
1
EXTRA_BATTERY_LOW → const String
Extra for 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 broadcast has been sent. [...]
"battery_low"
EXTRA_HEALTH → const String
Extra for android.content.Intent#ACTION_BATTERY_CHANGED: integer containing the current health constant. [...]
"health"
EXTRA_ICON_SMALL → const String
Extra for android.content.Intent#ACTION_BATTERY_CHANGED: integer containing the resource ID of a small status bar icon indicating the current battery state. [...]
"icon-small"
EXTRA_LEVEL → const String
Extra for android.content.Intent#ACTION_BATTERY_CHANGED: integer field containing the current battery level, from 0 to EXTRA_SCALE. [...]
"level"
EXTRA_PLUGGED → const String
Extra for 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. [...]
"plugged"
EXTRA_PRESENT → const String
Extra for android.content.Intent#ACTION_BATTERY_CHANGED: boolean indicating whether a battery is present. [...]
"present"
EXTRA_SCALE → const String
Extra for android.content.Intent#ACTION_BATTERY_CHANGED: integer containing the maximum battery level. [...]
"scale"
EXTRA_STATUS → const String
Extra for android.content.Intent#ACTION_BATTERY_CHANGED: integer containing the current status constant. [...]
"status"
EXTRA_TECHNOLOGY → const String
Extra for android.content.Intent#ACTION_BATTERY_CHANGED: String describing the technology of the current battery. [...]
"technology"
EXTRA_TEMPERATURE → const String
Extra for android.content.Intent#ACTION_BATTERY_CHANGED: integer containing the current battery temperature. [...]
"temperature"
EXTRA_VOLTAGE → const String
Extra for android.content.Intent#ACTION_BATTERY_CHANGED: integer containing the current battery voltage level. [...]
"voltage"