#Region Service Attributes
#StartAtBoot: False
#StartCommandReturnValue: android.app.Service.START_STICKY
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim test As Notification
Dim IDservice As Int = 1
Dim timer1Service As Timer
End Sub
Sub Service_Create
'This is the program entry point.
'This is a good place to load resources that are not specific to a single activity.
test.Initialize
test.Icon = "image1name" ' \Objects\res\drawable\image1name.png [read only to stay]
test.SetInfo("title","body",Main)
'Service.StartForeground(IDservice,test)
timer1Service.Initialize("timer1Service", 10000)
End Sub
Sub Service_Start (StartingIntent As Intent)
timer1Service.Enabled = True
End Sub
Sub Service_TaskRemoved
'This event will be raised when the user removes the app from the recent apps list.
End Sub
'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Sub Service_Destroy
End Sub
Sub timer1Service_tick
ToastMessageShow("Hello word!", True)
End Sub
Sub CreateService
Service.StartForeground(IDservice,test)
' send "Started" to sub "ShowMxgbox" of Main (Activity Module)
CallSubDelayed2(Main, "ShowMxgbox", "Started")
End Sub
Sub KillService
timer1Service.Enabled = False
Service.StopForeground(IDservice)
' send "Stopped" to sub "ShowMxgbox" of Main
CallSubDelayed2(Main, "ShowMxgbox", "Stopped")
StopService(Me)
End Sub
Sub SubOne(value1 As Int)
Dim str1 As String = value1
' send "value1" to sub "ShowMxgbox" of Main
CallSubDelayed2(Main, "ShowMxgbox", str1)
End Sub
Sub SubTwo(value1 As Int, value2 As String)
' send "value1 and value2" to sub "ShowMxgbox" of Main
CallSubDelayed3(Main, "ShowMxgboxValue2", value1, value2)
End Sub