mirror of
https://github.com/KeymonSoft/Mazapa-Reparto.git
synced 2026-04-20 14:29:17 +00:00
Version: 5.03.31
Se le agrego una vista al enviar informacion.
This commit is contained in:
@@ -34,7 +34,7 @@ Version=10.2
|
||||
|
||||
Sub Process_Globals
|
||||
Private nid As Int = 1
|
||||
dim Tracking As Boolean
|
||||
Dim Tracking As Boolean
|
||||
Private lock As PhoneWakeState
|
||||
'Para FusedLocationProvider (2 lineas)
|
||||
Public FLP As FusedLocationProvider
|
||||
@@ -45,6 +45,32 @@ Sub Process_Globals
|
||||
Dim trackerActividad, pushServiceActividad As String
|
||||
End Sub
|
||||
|
||||
Public Sub StartFLPSmall
|
||||
' Log("StartFLPSmall - flpStarted="&flpStarted)
|
||||
Do While FLP.IsConnected = False
|
||||
Sleep(500)
|
||||
Log("sleeping")
|
||||
Loop
|
||||
dameUltimaUbicacionConocida 'Regresamos ultima ubicacion conocida
|
||||
FLP.RequestLocationUpdates(CreateLocationRequestSmallD) 'Buscamos ubicacion 2 peticiones
|
||||
' Log("Buscamos ubicacion Small displacement")
|
||||
' Log("GPSSmallestDisplacement = " & actualLR.GetSmallestDisplacement)
|
||||
End Sub
|
||||
|
||||
Private Sub CreateLocationRequestSmallD As LocationRequest
|
||||
' Log("Iniciamos CreateLocationRequestSmallD")
|
||||
Dim lr As LocationRequest
|
||||
lr.Initialize
|
||||
lr.SetInterval(2000) 'Intervalo deseado para actualizaciones de ubicacion
|
||||
lr.SetFastestInterval(lr.GetInterval / 2) 'Intervalo minimo para actualizaciones de ubicacion
|
||||
lr.setNumUpdates(2) 'Solicitamos solo 2 actualizaciones con estos parametros
|
||||
lr.SetSmallestDisplacement(1) 'Solo registra cambio de ubicacion si es mayor a XX mts
|
||||
lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY)
|
||||
actualLR=lr
|
||||
Return lr
|
||||
End Sub
|
||||
|
||||
|
||||
Sub Service_Create
|
||||
Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER 'we are handling it ourselves
|
||||
UUGCoords.Initialize
|
||||
@@ -103,10 +129,10 @@ Public Sub StartFLP
|
||||
Loop
|
||||
' If flpStarted = False Then
|
||||
' If Main.logger Then Log("RequestLocationUpdates")
|
||||
FLP.RequestLocationUpdates(CreateLocationRequest) 'Buscamos ubicacion
|
||||
FLP.RequestLocationUpdates(CreateLocationRequest) 'Buscamos ubicacion
|
||||
' If Main.logger Then Log("Buscamos ubicacion")
|
||||
' If Main.logger Then Log(actualLR.GetSmallestDisplacement)
|
||||
flpStarted = True
|
||||
flpStarted = True
|
||||
' End If
|
||||
End Sub
|
||||
|
||||
@@ -174,7 +200,7 @@ Sub flp_LocationChanged (Location1 As Location)
|
||||
' CallSubDelayed2(gestion, "GPS_LocationChanged", Location1)
|
||||
B4XPages.MainPage.lat_gps = Location1.Latitude
|
||||
B4XPages.MainPage.lon_gps = Location1.Longitude
|
||||
'/////// para la ultima ubicacion FL
|
||||
'/////// para la ultima ubicacion FL
|
||||
Dim sDate,sTime As String
|
||||
DateTime.DateFormat = "MM/dd/yyyy"
|
||||
sDate=DateTime.Date(DateTime.Now)
|
||||
@@ -185,7 +211,7 @@ Sub flp_LocationChanged (Location1 As Location)
|
||||
Catch
|
||||
If B4XPages.MainPage.logger Then Log("Error al borrar o insertar nuevas coordendas en HIST_GPS")
|
||||
End Try
|
||||
'///////
|
||||
'///////
|
||||
Dim coords As String = Location1.Latitude&","&Location1.Longitude&","&formatoFecha(Location1.Time)
|
||||
Log("Loc changed : "&Location1.Latitude&","&Location1.Longitude)
|
||||
If B4XPages.MainPage.logger Then Log("Mandamos Ubicacion")
|
||||
@@ -213,7 +239,7 @@ Sub CreateNotification (Body As String) As Notification 'ignore
|
||||
Dim notification As Notification
|
||||
notification.Initialize2(notification.IMPORTANCE_LOW)
|
||||
notification.Icon = "icon"
|
||||
notification.SetInfo("MAZAPA REPARTO", Body, Main)
|
||||
notification.SetInfo("GUNA REPARTO", Body, Main)
|
||||
Return notification
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user