#Region Service Attributes
#StartAtBoot: True
#StartCommandReturnValue: android.app.Service.START_STICKY
#End Region
Sub Process_Globals
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
Try
If StartingIntent.HasExtra("android.intent.extra.ALARM_COUNT") Then
StartServiceAt("", TimeToNextSeconds (60), False)
Else
StartServiceAt("", TimeToNextSeconds (5), False)
End If
Catch
StartActivity(Main)
End Try
DateTime.DateFormat = "dd/MM/yyyy HH:MM:ss"
Log(DateTime.Date(DateTime.Now) & " hello")
StartStompClient
End Sub
Sub TimeToNextSeconds (aSeconds As Int)As Long
Dim ret As Long
Log("Service stars on " & aSeconds)
ret = DateTime.Now + DateTime.TicksPerSecond * aSeconds
ret = ret - (ret Mod DateTime.TicksPerSecond)
Return ret
End Sub
Private Sub StartStompClient
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_MAIN, "")
Intent1.SetComponent("it.android.imgspa.and_StompClient/.Main")
Intent1.Flags = 33554432
StartActivity(Intent1)
End Sub