Share via


Battery Class

Definition

Methods and properties for battery and charging information of the device.

public ref class Battery abstract sealed
public static class Battery
type Battery = class
Public Class Battery
Inheritance
Battery

Remarks

Platform specific remarks:

- Android: Battery_Stats permission must be set in manifest.

- iOS: Simulator will not return battery information, must be run on device

- UWP: None

Properties

ChargeLevel

Gets the current charge level of the device from 0.0 to 1.0.

Default

Provides the default implementation for static usage of this API.

EnergySaverStatus

Gets the current energy saver status of the device.

PowerSource

Gets the current power source for the device.

State

Gets the charging state of the device.

Events

BatteryInfoChanged

Event trigger when battery properties have changed.

EnergySaverStatusChanged

Occurs when the energy saver status changes.

Applies to