UIKit.UIDevice.BatteryLevel Property
Battery level indicator.

Syntax

[get: Foundation.Export("batteryLevel")]
public virtual float BatteryLevel { get; }

Value

Battery percentage in the range [0..1] if battery monitoring is enabled, otherwise -1.

Remarks

By default, UIDevice.BatteryMonitoringEnabled is false. In that situation, UIDevice.BatteryLevel will be -1 (and UIDevice.BatteryState will be UIDeviceBatteryState.Unknown).

A value of 1.0 indicates a fully-charged device, while 0.0 indicates an empty battery.

This can be used from a background thread.

Requirements

Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0