Modificacion del GPS 4.10.10

This commit is contained in:
cvaldes1201
2024-10-14 12:32:21 -06:00
parent 208a7c4b98
commit 618966b8b5
6 changed files with 46 additions and 11 deletions

View File

@@ -82,7 +82,7 @@ Version=12.8
#AdditionalJar: com.google.android.gms:play-services-location #AdditionalJar: com.google.android.gms:play-services-location
#ApplicationLabel: AREstrategicas #ApplicationLabel: AREstrategicas
#VersionCode: 1 #VersionCode: 1
#VersionName: 3.12.27 #VersionName: 4.10.10
'SupportedOrientations possible values: unspecified, landscape or portrait. 'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait #SupportedOrientations: portrait
#CanInstallToExternalStorage: False #CanInstallToExternalStorage: False

View File

@@ -34,6 +34,6 @@ ModuleClosedNodes6=
ModuleClosedNodes7= ModuleClosedNodes7=
ModuleClosedNodes8= ModuleClosedNodes8=
ModuleClosedNodes9= ModuleClosedNodes9=
NavigationStack=c_datos,InitializeCamera2,1652,0,C_principal,Class_Globals,0,0,C_principal,b_enviar_Click,549,1,C_principal,JobDone,530,0,Main,Globals,24,0,c_datos,cb_socioeconomico_SelectedIndexChanged,1640,0,c_datos,Class_Globals,30,0,Diseñador Visual,datos.bal,-100,6,Diseñador Visual,gestion.bal,-100,4,c_datos,B4XPage_Created,153,0 NavigationStack=B4XMainPage,ImageView5_Click,166,0,C_principal,Class_Globals,17,0,c_datos,Class_Globals,31,0,Tracker,StartFLP2,108,0,C_principal,B4XPage_Appear,77,1,c_datos,B4XPage_Created,144,0,Tracker,CreateLocationRequest,122,0,c_datos,B4XPage_Appear,258,1,Tracker,flp_LocationChanged,185,2,c_datos,GPS_LocationChanged,2227,2
SelectedBuild=0 SelectedBuild=0
VisibleModules=9,2,4,3,10,7,6,11,1,5 VisibleModules=9,2,4,3,10,7,6,11,1,5

View File

@@ -169,8 +169,8 @@ End Sub
Private Sub ImageView5_Click Private Sub ImageView5_Click
p_configuracion.Visible = True p_configuracion.Visible = True
lv_server.Clear lv_server.Clear
lv_server.AddSingleLine("http://keymon.lat:1783") lv_server.AddSingleLine("http://keymon.lat:9001")
If Usuario.Text = "KMTS1" Then lv_server.AddSingleLine("http://11.0.0.196:1783") ' If Usuario.Text = "KMTS1" Then lv_server.AddSingleLine("http://11.0.0.196:1783")
' l_server.Text = Starter.server ' l_server.Text = Starter.server
et_server.Text = Starter.DBReqServer et_server.Text = Starter.DBReqServer
l_version.Visible = False l_version.Visible = False

View File

@@ -14,7 +14,7 @@ Sub Process_Globals
'These variables can be accessed from all modules. 'These variables can be accessed from all modules.
Public rp As RuntimePermissions Public rp As RuntimePermissions
Dim reqManager As DBRequestManager Dim reqManager As DBRequestManager
Dim DBReqServer As String = "http://keymon.lat:1783" '"http://keymon.lat:1788" "http://11.0.0.196:1782" "http://keymon.lat:1783" "http://11.0.0.48:1783" ""' CAMBIAR HACIA AFUERA O DENTRO DE LA OFNA Dim DBReqServer As String = "http://keymon.lat:9001" '"http://keymon.lat:1788" "http://11.0.0.196:1782" "http://keymon.lat:1783" "http://11.0.0.48:1783" ""' CAMBIAR HACIA AFUERA O DENTRO DE LA OFNA
' Dim server As String = "http://10.0.0.205:1782" ' Dim server As String = "http://10.0.0.205:1782"
Dim rutaBD As String = File.DirInternal Dim rutaBD As String = File.DirInternal
Dim skmt As SQL Dim skmt As SQL

View File

@@ -124,9 +124,9 @@ Private Sub CreateLocationRequest As LocationRequest
If logger Then Log("CreateLocationRequest") If logger Then Log("CreateLocationRequest")
Dim lr As LocationRequest Dim lr As LocationRequest
lr.Initialize lr.Initialize
lr.SetInterval(10000) 'Intervalo deseado para actualizaciones de ubicacion lr.SetInterval(1) 'Intervalo deseado para actualizaciones de ubicacion
lr.SetFastestInterval(lr.GetInterval / 2) 'Intervalo minimo para actualizaciones de ubicacion lr.SetFastestInterval(lr.GetInterval / 2) 'Intervalo minimo para actualizaciones de ubicacion
lr.SetSmallestDisplacement(75) 'Solo registra cambio de ubicacion si es mayor a XX mts lr.SetSmallestDisplacement(0) 'Solo registra cambio de ubicacion si es mayor a XX mts
lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY) lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY)
actualLR=lr actualLR=lr
Return lr Return lr
@@ -188,6 +188,9 @@ Sub flp_LocationChanged (Location1 As Location)
' End Try ' End Try
' End If ' End If
If B4XPages.MainPage.datos.IsInitialized Then
CallSub2(B4XPages.GetPage("datos"), "GPS_LocationChanged", Location1)
End If
End Sub End Sub

View File

@@ -35,6 +35,7 @@ Sub Class_Globals
Dim device As Phone Dim device As Phone
Dim MES1 As ManageExternalStorage Dim MES1 As ManageExternalStorage
Dim x As Int = 0 Dim x As Int = 0
Dim GPS As GPS
'Datos generales 'Datos generales
Private l_nombreg As Label Private l_nombreg As Label
Private l_rfc As Label Private l_rfc As Label
@@ -147,7 +148,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
p_w3.Visible = False p_w3.Visible = False
p_camara.Width = Root.Width p_camara.Width = Root.Width
p_camara.Height = Root.Height p_camara.Height = Root.Height
GPS.Initialize("GPS")
ScrollView1.height = Root.Height - Panel1.Height -WobbleMenu1.Height ScrollView1.height = Root.Height - Panel1.Height -WobbleMenu1.Height
p_w1.height = Root.Height - Panel1.Height -WobbleMenu1.Height p_w1.height = Root.Height - Panel1.Height -WobbleMenu1.Height
@@ -257,7 +258,33 @@ Private Sub B4XPage_Created (Root1 As B4XView)
End Sub End Sub
Private Sub B4XPage_Appear Private Sub B4XPage_Appear
If GPS.GPSEnabled=False Then
Dim Resultado As Int= -3
Do While Resultado=-3
Resultado = Msgbox2("Habilitar el GPS", "Atencion","ACEPTAR","", "",LoadBitmap(File.DirAssets,"alert2.png"))
Select Case Resultado
Case DialogResponse.POSITIVE
MsgboxAsync("Habilitar el GPS", "Atencion")
StartActivity(GPS.LocationSettingsIntent)
Case DialogResponse.NEGATIVE
B4XPage_Appear
End Select
Loop
Else
' Log("ENTRE")
StartService(Tracker)
' m_lat = "0"
' m_lon = "0"
GPS_LocationChanged(Tracker.FLP.GetLastKnownLocation)
End If
WobbleMenu1.SetCurrentTab(1) WobbleMenu1.SetCurrentTab(1)
p_w1.Visible = True p_w1.Visible = True
parentesco = "" parentesco = ""
@@ -2181,7 +2208,13 @@ Private Sub B4XPage_CloseRequest As ResumableSub
End Sub End Sub
Sub GPS_LocationChanged (Location1 As Location) Sub GPS_LocationChanged (Location1 As Location)
' LogColor($"Entrando a Cliente.GPS_LocationChanged"$, Colors.red)
If Tracker.FLP.GetLastKnownLocation.IsInitialized And Tracker.FLP.GetLastKnownLocation.Latitude <> 0 Then
Starter.latitud = Tracker.FLP.GetLastKnownLocation.Latitude
Starter.longitud= Tracker.FLP.GetLastKnownLocation.Longitude
' Log("Coords set to: " & B4XPages.MainPage.lat_gps & " and " & B4XPages.MainPage.lon_gps)
End If
CallSubDelayed(Tracker, "CreateLocationRequest")
' ubicacion.Initialize ' ubicacion.Initialize
' ubicacion.Latitude = mlat ' ubicacion.Latitude = mlat
' ubicacion.Longitude = mlon ' ubicacion.Longitude = mlon
@@ -2198,6 +2231,5 @@ Sub GPS_LocationChanged (Location1 As Location)
'' Log(Starter.latitud & " , " & Starter.longitud) '' Log(Starter.latitud & " , " & Starter.longitud)
' l_ubicacion.Text = $"Dist: $1.0{distance} mts."$ ' l_ubicacion.Text = $"Dist: $1.0{distance} mts."$
' If laDist > 50 Then l_ubicacion.TextColor = Colors.Red Else l_ubicacion.TextColor = Colors.Blue ' If laDist > 50 Then l_ubicacion.TextColor = Colors.Red Else l_ubicacion.TextColor = Colors.Blue
Starter.longitud = Location1.Longitude Log(Starter.longitud &" "& Starter.latitud)
Starter.latitud = Location1.Latitude
End Sub End Sub