'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 servicerunning As Boolean
Dim notification1 As Notification
Dim smsInt As SmsInterceptor
Dim mFrom As String
Dim mText As String
End Sub
Sub Service_Create
smsInt.Initialize2("smsInt", 999)
notification1.Initialize
notification1.Icon = "icon"
notification1.Vibrate = True
notification1.Sound = True
Log("Service initialized")
End Sub
Sub Service_Start (StartingIntent As Intent)
StartServiceAt("", DateTime.Now + 10 * DateTime.TicksPerSecond, True)
Log("Service Started")
End Sub
Sub Service_Destroy
smsInt.StopListening()
End Sub
Sub smsInt_MessageReceived (From As String, Body As String) As Boolean
Log("Message Received From: " & From)
mFrom = From
mText = Body
notification1.SetInfo("From: " & mFrom, mText, Main)
Return False
End Sub