Basic provides several functions which can be used to monitor the status of the battery.
0 = Waiting for Data
This function returns the current battery level.
This function returns the maximum battery level.
Percent = GetBatteryLevel() / GetBatteryScale() * 100
This function returns the current battery temperature in celsius.
This function returns the current battery voltage.
It takes a few seconds for battery info to be returned from Android the first time you request the info. Placing the following code at the beginning of your program will pause your program until the data becomes available.
timeout = Time() + 5000