Search Results for

    Show / Hide Table of Contents

    Class Battery

    Battery and charging information of the device.

    Inheritance
    object
    Battery
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Evergine.Platform
    Assembly: Evergine.Platform.dll
    Syntax
    public class Battery : IDisposable
    Remarks

    Needs BATTERY_STATS permission set in manifest for Android.

    Constructors

    Battery()

    Initializes a new instance of the Battery class.

    Declaration
    public Battery()

    Properties

    ChargeLevel

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

    Declaration
    public float ChargeLevel { get; }
    Property Value
    Type Description
    float
    Remarks

    Needs BATTERY_STATS permission set in manifest for Android.

    EnergySaverStatus

    Gets the current energy saver status of the device.

    Declaration
    public EnergySaverStates EnergySaverStatus { get; }
    Property Value
    Type Description
    EnergySaverStates
    Remarks

    Needs BATTERY_STATS permission set in manifest for Android.

    IsSupported

    Gets a value indicating whether the battery tracker is supported on the current platform.

    Declaration
    public bool IsSupported { get; }
    Property Value
    Type Description
    bool

    PowerSource

    Gets the current power source for the device.

    Declaration
    public BatteryPowerSources PowerSource { get; }
    Property Value
    Type Description
    BatteryPowerSources
    Remarks

    Needs BATTERY_STATS permission set in manifest for Android.

    State

    Gets the charging state of the device if it can be determined.

    Declaration
    public BatteryStates State { get; }
    Property Value
    Type Description
    BatteryStates
    Remarks

    Needs BATTERY_STATS permission set in manifest for Android.

    Methods

    Dispose()

    Declaration
    public void Dispose()

    Events

    BatteryInfoChanged

    Occurs when battery properties have changed.

    Declaration
    public event EventHandler BatteryInfoChanged
    Event Type
    Type Description
    EventHandler

    EnergySaverStatusChanged

    Occurs when energy saver status have changed.

    Declaration
    public event EventHandler EnergySaverStatusChanged
    Event Type
    Type Description
    EventHandler

    Implements

    IDisposable

    Extension Methods

    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In This Article
    Back to top
    Generated by DocFX