Hello all,
I just want to know the mobile battery health in words.
I using below code :
B4X:
Sub Process_Globals
Private gp_phoneevents As PhoneEvents
End Sub
Sub Service_Create
gp_phoneevents.Initialize("PhoneEvents")
End Sub
Sub PhoneEvents_BatteryChanged (Level As Int, Scale As Int, Plugged As Boolean, Intent As Intent)
Dim ls_health As Int = Intent.GetExtra("health")
Log("Health : " & ls_health)
End Sub
The Log result is :
B4X:
Health : 2
Now Question is, What is the means by "2"?
It's mean by Good or bad ?
This might help. There is a BatteryUtilities class in the BatteryProgressView library that can give you more battery information without waiting for an event
A wrap for this Github project. The is a B4A (with inline Java code) that drives the view with the current battery status - updated every 20 seconds via a timer. Sample Code Main Activity: #Region Project Attributes #ApplicationLabel: b4aBatteryProgressView #VersionCode: 1...