'0 = Unknown, 1 = Unplugged, 2 = Charging, 3 = Full
Sub BatteryState As Int
Dim no As NativeObject
no = no.Initialize("UIDevice").RunMethod("currentDevice", Null)
If no.GetField("batteryMonitoringEnabled").AsBoolean = False Then
no.SetField("batteryMonitoringEnabled", True)
End If
Return no.GetField("batteryState").AsNumber
End Sub