#Region Service Attributes
#StartAtBoot: true
#StartCommandReturnValue: android.app.Service.START_STICKY
#End Region
Sub Service_Start (StartingIntent As Intent)
StartServiceAt(Me, DateTime.Now + 2 * DateTime.TicksPerMinute, False)
If wsh.IsInitialized = False Or wsh.ws.Connected = False Then
Connect
End If
If IsPaused(Main) = False Then
CallSub2(Main, "UpdateId", id)
CallSub2(Main, "UpdateStatus", wsh.ws.Connected)
'Show stored messages
Dim messages As List = kvs.GetObject("messages")
If messages.Size > 0 Then
CallSub2(Main, "NewMessage", messages)
messages.Clear
kvs.PutObject("messages", messages)
End If
End If
End Sub