Cambio de puerto

This commit is contained in:
2023-11-07 18:59:47 -06:00
parent 68bac1707c
commit 9ed8905671
10 changed files with 508 additions and 140 deletions

View File

@@ -46,7 +46,7 @@ Sub Process_Globals
End Sub
Sub Service_Create
Starter.ruta = File.DirInternal
Subs.revisaBD
fm.Initialize("fm") 'Inicializamos FirebaseMessaging
Subs.getPhnId
pe.Initialize("pe") 'Para obtener la bateria
@@ -67,8 +67,6 @@ End Sub
Sub Service_Start (StartingIntent As Intent)
Subs.getPhnId
Subs.gps_hist.Initialize(Starter.ruta,"gps_hist.db", True)
Subs.gps_hist.ExecNonQuery("CREATE TABLE IF NOT EXISTS RUTA_GPS(FECHA INTEGER, LAT TEXT, LON TEXT)")
If StartingIntent.IsInitialized Then fm.HandleIntent(StartingIntent)
Sleep(0)
Service.StopAutomaticForeground 'remove if not using B4A v8+.
@@ -86,7 +84,7 @@ Sub fm_MessageArrived (Message As RemoteMessage)
If Starter.logger Then Log("Es una peticion de ubicacion")
If Starter.logger Then Log($"UUC: ${Starter.UUC.Latitude},${Starter.UUC.Longitude}"$)
If Starter.UUC.Latitude <> 0.0 Then
mandamosLoc(Starter.UUC)
mandaLocFM(Starter.UUC)
If Starter.logger Then LogColor($"Mandamos UUC: ${Starter.UUC.Latitude},${Starter.UUC.Longitude},${Subs.formatoFecha(Starter.UUC.Time)}"$, Colors.Magenta)
End If
locRequest="Activa"
@@ -156,11 +154,9 @@ Sub SendMessage(params As Map)
If Starter.logger Then Log("Mandamos mensaje: " & m)
End Sub
Sub mandamosLoc(loc As Location)
Sub mandaLocFM(loc As Location)
Dim coords As String = loc.Latitude & ","&loc.Longitude & ","&Subs.formatoFecha(DateTime.Now)
If Starter.logger Then LogColor("Iniciamos mandamosLoc ("&coords&")", Colors.Magenta)
' Log("locRequest="&locRequest)
Subs.guardaInfoEnBD(coords)'Escribimos coordenadas y fecha a una bd
If Starter.logger Then LogColor("Iniciamos mandaLocFM ("&coords&")", Colors.Magenta)
Dim t As String
If locRequest="Activa" Then
If au = 1 Then