#Region Service Attributes
#StartAtBoot: False
#ExcludeFromLibrary: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Public server As Socket
Public AStreams As AsyncStreams
Public GPS1 As GPS
End Sub
Sub Service_Create
GPS1.Initialize("GPS1")
server.Initialize("server")
server.Connect("192.168.1.4",5562,5000)
End Sub
Sub Service_Start (StartingIntent As Intent)
If (GPS1.IsInitialized = True) Then
If GPS1.GPSEnabled = False Then
ToastMessageShow("Por favor , ative o GPS !", True)
StartActivity(GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
End If
Else
Msgbox("Não foi possível inicializar o GPS .","Erro ao iniciar GPS.")
ExitApplication
End If
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 server_Connected (Successful As Boolean)
If (Successful = True ) Then
Log("Connectado !")
End If
End Sub