Android Question [SOLVED] I need to get battery level

Discussion in 'Android Questions' started by boralogy, Mar 15, 2015.

  1. boralogy

    boralogy Member Licensed User

    hi,
    I need to get battery level but os library returns NULL.
    Could you help me?
     
  2. boralogy

    boralogy Member Licensed User

    ok SOLVED
    Code:
    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
     
    Daniel-White, dagodom, GvD and 2 others like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice