From Xojo Documentation
|You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!|
The amount of battery remaining.
A value of 0.0 means the battery is full discharged. A value of 1.0 means the battery is fully charged.
This example enables monitoring of the battery, gets the current battery level, disables battery monitoring and then displays the level in a message box:
Var batteryPercentage As Integer = System.Device.BatteryLevel * 100
System.Device.BatteryMonitoringEnabled = False
MessageBox("Your battery is at " + batteryLevel.ToString + "%")