Android Question Return current battery level and if on charge

Similar threads

Share My Creation Battery Charge Alarm
B4A Question Awesome font Additions
B4A Library BatteryView
B4A Library BatteryProgressView
Games [XUI2D] Example Pack


Active Member
Licensed User
I've had a look through some previous questions and I can't seem to find a clear sub that just returns the value.

Is there a simple sub for these?

Battery Level 0 - 100
Charging 0 or 1



Active Member
Licensed User
I've just found it.

Sub B_BatteryChanged (Level As Int, Scale As Int, Plugged As Boolean, Intent As Intent)
Log("BatteryChanged: Level = " & Level & ", Scale = " & Scale & ", Plugged = " & Plugged)
End Sub