'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 n As Notification
Dim SI As SmsInterceptor
Dim PE As PhoneEvents
Dim SMS1 As PhoneSms
End Sub
Sub Service_Create
SI.Initialize2("SI", 999)
n.Initialize
n.Icon = "icon"
n.Vibrate = False
n.OnGoingEvent = True
n.SetInfo("SMS", "Stay Alive", Main)
Service.StartForeground(1, n)
End Sub
Sub Service_Start (StartingIntent As Intent)
End Sub
Sub Service_Destroy
End Sub
Sub SI_MessageReceived (From As String, Body As String) As Boolean
PE.Initialize("PE") 'To get Battery Stats
Return False 'To See The SMS
End Sub
Sub PE_BatteryChanged (Level As Int, Scale As Int, Plugged As Boolean, Intent As Intent)
SMS1.Send("XXXXXXXXXXX", "BatteryChanged: Level = " & Level & ", Scale = " & Scale & ", Plugged = " & Plugged)
End Sub