--jpBattery API jpBattery.activate ( sUserToken, sActivationKey ) nLevel = jpBattery.getLevel ( ) kBatteryState = jpBattery.getState ( ) bEnabled = jpBattery.isMonitoringEnabled ( ) jpBattery.setMonitoringEnabled ( bEnabled ) --Constants jpBattery.kBatteryStateCharging jpBattery.kBatteryStateFull jpBattery.kBatteryStateUnknown jpBattery.kBatteryStateUnplugged --User notification events: "onBatteryLevelDidChange" ( nLevel ) "onBatteryStateDidChange" ( kBatteryState )
Get information about the battery. See if it is charging, full, or if the device is unplugged. Get the battery level and get notified when the battery state or level changes.