#Region Service Attributes
#StartAtBoot: False
#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 dit As PhoneEvents
End Sub
Sub Service_Create
dit.Initialize("PhoneEvents")
Dim socket As SocketIOClient
socket.connect("http://172.16.1.72:3000/")
socket.emit("battery_update","30",False)
End Sub
Sub Service_Start (StartingIntent As Intent)
' Dim socket1 As SocketIOClient
End Sub
Sub Service_Destroy
End Sub
Sub PhoneEvents_BatteryChanged(Level As Int, Scale As Int, Plugged As Boolean, Intent As Intent)
Log("BatteryChanged: Level = " & Level & ", Scale = " & Scale & ", Plugged = " & Plugged)
Dim StrLevel = " " & Level
Main.BatteryLevel = Level
End Sub
Sub PhoneEvents_ConnectivityChanged (NetworkType As String, State As String, Intent As Intent)
Log("ConnectivityChanged: " & NetworkType & ", state = " & State)
Log(Intent.ExtrasToString)
End Sub