'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 SI As SmsInterceptor
Dim Notification1 As Notification
End Sub
Sub Service_Create
SI.Initialize2("SI", 999)
Notification1.Initialize
Notification1.Icon = "icon" 'use the application icon file for the notification
Notification1.Vibrate = False
Log("Service initialized")
End Sub
Sub Service_Start (StartingIntent As Intent)
Notification1.SetInfo("SMS Example", "test started", Main)
Notification1.Sound = False
Service.StartForeground(1, Notification1)
Log("Service Started")
End Sub
Sub Service_Destroy
SI.StopListening()
Service.StopForeground(1)
End Sub
Sub SI_MessageReceived (From As String, Body As String)
Log("Message Received From: " & From)
ToastMessageShow(From, True)
Log("Toast shown")
Return True ' I've also tried Return False, as I don't want the standard SMS app to be skipped if possible
End Sub