Android Question [SOLVED] I need to get battery level

boralogy

Member
Licensed User
Longtime User
hi,
I need to get battery level but os library returns NULL.
Could you help me?
 

boralogy

Member
Licensed User
Longtime User
ok SOLVED
B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private bat_lvl As Label
    Private Label1 As Label
    Dim hg As PhoneEvents
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("low_main")
   

hg.Initialize("hg")



End Sub
Sub hg_BatteryChanged (Level As Int, Scale As Int, Plugged As Boolean, Intent As Intent)
   bat_lvl.Text = Level
End Sub
 
Upvote 0
Top