Sub Service_Start(StartingIntent As Intent)
Log("Connection.Service_Start")
Dim n As Notification
n.Initialize
n.Icon="icon"
n.Sound=False
n.Light = False
n.Vibrate = False
n.SetInfo("Alarm","Listening for a Alarm Message",Main)
Service.StartForeground(1,n)
PhoneWakeState1.PartialLock
PhoneEvents1.Initialize("PhoneEvents1")
End Sub
Sub Service_TaskRemoved
'This event will be raised when the user removes the app from the recent apps list.
Log("Connection.Service_TaskRemoved")
PhoneWakeState1.ReleasePartialLock
End Sub
Sub Service_Destroy
Log("Connection.Service_Destroy")
PhoneWakeState1.ReleasePartialLock
End Sub
Sub PhoneEvents1_ConnectivityChanged(NetworkType As String, State As String, Intent As Intent)
Log("PhoneEvents1_ConnectivityChanged")
'NetworkType - WIFI or MOBILE.
'#State - One of the following values: CONNECTING, CONNECTED, SUSPENDED, DISCONNECTING, DISCONNECTED, UNKNOWN.
If State = "CONNECTED" Then
If ToastMessageOnOff Then ToastMessageShow("Connectivity Changed, Network Type " & NetworkType,False)
End If
End Sub