'Service module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim pe As PhoneEvents
Dim Running As Boolean
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
Dim pev As PhoneEvents
pev.Initialize("pe")
pe = pev
Running = True
End Sub
Sub Service_Destroy
pe.StopListening
Running = False
End Sub
Sub pe_BatteryChanged (Level As Int, Scale As Int, Plugged As Boolean, Intent As Intent)
Log("Level: " & Level & ", Scale: " & Scale & ", Plugged: " & Plugged)
End Sub