A Boolean value indicating whether or not the device's battery is currently being charged.
Indicates the amount of time, in seconds, that remain until the battery is fully charged.
Indicates the amount of time, in seconds, that remains until the battery is fully discharged.
Indicates the current battery charge level as a value between 0.0 and 1.0.
The BatteryManager interface provides ways to get information about the system's battery charge level.
Specifies an event listener to receive chargingchange events. These events occur when the battery charging state is updated.
Specifies an event listener to receive chargingtimechange events. These events occur when the battery chargingTime is updated.
Specifies an event listener to receive dischargingtimechange events. These events occur when the battery dischargingTime is updated.
Specifies an event listener to receive levelchange events. These events occur when the battery level is updated.
The getBattery() method provides information about the system's battery, returns a battery promise, which is resolved in a BatteryManager object providing also some new events you can handle to monitor the battery status.. This implements the Battery Status API; see that documentation for additional details, a guide to using the API, and sample code.
The Battery Status API, more often referred to as the Battery API, provides information about the system's battery charge level and lets you be notified by events that are sent when the battery level or charging status change. This can be used to adjust your app's resource usage to reduce battery drain when the battery is low, or to save changes before the battery runs out in order to prevent data loss.