- VERSION 4.12.09

- Se cambiaron los permisos de Activity a B4XPage
This commit is contained in:
Jose Alberto Guerra Ugalde
2024-12-09 18:54:32 -06:00
parent a50d2319d1
commit aeae049d52
7 changed files with 33 additions and 22 deletions

View File

@@ -246,7 +246,7 @@ Sub B4XPage_Appear
LogColor($"////////////////// DeviceID: ${DeviceID} ////////////////// "$, Colors.Blue) LogColor($"////////////////// DeviceID: ${DeviceID} ////////////////// "$, Colors.Blue)
LogColor("Revisa permisos Phone_State", Colors.Green) LogColor("Revisa permisos Phone_State", Colors.Green)
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_READ_PHONE_STATE) Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_READ_PHONE_STATE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean) Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
If Result Then If Result Then
IMEN.Text = Phn.GetDeviceId IMEN.Text = Phn.GetDeviceId
IMEI = Phn.GetDeviceId IMEI = Phn.GetDeviceId
@@ -254,7 +254,7 @@ Sub B4XPage_Appear
IMEI="" 'Pruebas IMEI="" 'Pruebas
End If End If
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION) Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean) Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
If Result Then If Result Then
StartService(Tracker) StartService(Tracker)
Log("Start Tracker") Log("Start Tracker")
@@ -565,7 +565,7 @@ End Sub
Sub copiaDB Sub copiaDB
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE) Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean) Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
Dim theDir As String = "" Dim theDir As String = ""
If Result Then If Result Then
Dim theDir As String Dim theDir As String

View File

@@ -325,6 +325,10 @@ Private Sub B4XPage_Created (Root1 As B4XView)
SV_ENCUESTA.Width = Root.Height SV_ENCUESTA.Width = Root.Height
p_pregunta1.Height = Root.Height p_pregunta1.Height = Root.Height
p_pregunta1.Width = Root.Height p_pregunta1.Width = Root.Height
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_CAMERA)
Wait For B4XPage_PermissionResult (Permission As String, resultC As Boolean)
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For B4XPage_PermissionResult (Permission As String, resultC As Boolean)
End Sub End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage. 'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
@@ -332,10 +336,6 @@ End Sub
Sub B4XPage_Appear Sub B4XPage_Appear
B4XPages.MainPage.tipo_venta = tipo_venta B4XPages.MainPage.tipo_venta = tipo_venta
encuentasmapa.Initialize encuentasmapa.Initialize
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_CAMERA)
Wait For Activity_PermissionResult (Permission As String, resultC As Boolean)
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, resultC As Boolean)
LA_GPS.TextColor = Colors.Red LA_GPS.TextColor = Colors.Red
LA_GPS.Text = "SIN UBICACION GPS" LA_GPS.Text = "SIN UBICACION GPS"
@@ -364,8 +364,14 @@ Sub B4XPage_Appear
l_total.Text = s.GetString("TOTAL_CLIE") l_total.Text = s.GetString("TOTAL_CLIE")
total_cliente = s.GetString("TOTAL_CLIE") total_cliente = s.GetString("TOTAL_CLIE")
m_lat = "0" m_lat = "0"
If c.GetString("CAT_CL_LAT") <> "" Then m_lat =c.GetString("CAT_CL_LAT") If c.GetString("CAT_CL_LAT") <> "" Then
If m_lat.Length < 5 Then m_lat = "0" Log(1)
m_lat = c.GetString("CAT_CL_LAT")
End If
If m_lat.Length < 5 Then
Log(2)
m_lat = "0"
End If
m_lon = "0" m_lon = "0"
If c.GetString("CAT_CL_LONG") <> "" Then m_lon =c.GetString("CAT_CL_LONG") If c.GetString("CAT_CL_LONG") <> "" Then m_lon =c.GetString("CAT_CL_LONG")
If m_lon.Length < 5 Then m_lon = "0" If m_lon.Length < 5 Then m_lon = "0"
@@ -443,9 +449,10 @@ Sub B4XPage_Appear
Tels.Visible = True Tels.Visible = True
gest.Visible = True gest.Visible = True
End If End If
Log("LLAMAMOS TTRACJER")
CallSubDelayed(Tracker, "Track") CallSubDelayed(Tracker, "Track")
CallSubDelayed(Tracker, "StartFLPSmall") CallSubDelayed(Tracker, "StartFLPSmall")
If Tracker.FLP.GetLastKnownLocation.IsInitialized Then 'Si tenemos "UltimaUbicaccionConocida" la usamos. If tracker.FLP.IsInitialized and Tracker.FLP.GetLastKnownLocation.IsInitialized Then 'Si tenemos "UltimaUbicaccionConocida" la usamos.
B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastKnownLocation.Latitude B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastKnownLocation.Latitude
B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastKnownLocation.Longitude B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastKnownLocation.Longitude
' Log($"Tenemos UUC: ${Tracker.FLP.GetLastKnownLocation.Latitude},${Tracker.FLP.GetLastKnownLocation.Longitude}"$) ' Log($"Tenemos UUC: ${Tracker.FLP.GetLastKnownLocation.Latitude},${Tracker.FLP.GetLastKnownLocation.Longitude}"$)
@@ -474,16 +481,19 @@ Sub B4XPage_Appear
End Sub End Sub
Sub GPS_LocationChanged (Location1 As Location) Sub GPS_LocationChanged (Location1 As Location)
' LogColor($"Entrando a Cliente.GPS_LocationChanged"$, Colors.red) LogColor($"Entrando a Cliente.GPS_LocationChanged"$, Colors.red)
If Tracker.FLP.GetLastKnownLocation.IsInitialized And Tracker.FLP.GetLastKnownLocation.Latitude <> 0 Then If Tracker.FLP.GetLastKnownLocation.IsInitialized And Tracker.FLP.GetLastKnownLocation.Latitude <> 0 Then
B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastKnownLocation.Latitude B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastKnownLocation.Latitude
B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastKnownLocation.Longitude B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastKnownLocation.Longitude
' Log("Coords set to: " & B4XPages.MainPage.lat_gps & " and " & B4XPages.MainPage.lon_gps) ' Log("Coords set to: " & B4XPages.MainPage.lat_gps & " and " & B4XPages.MainPage.lon_gps)
End If End If
If m_lat.Length < 4 Then
m_lat = "0"
m_lon = "0"
End If
Dim l1, l2 As Location Dim l1, l2 As Location
l1.Initialize2(B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps) l1.Initialize2(B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps)
' Log($"Coordenadas de la tienda - lat:${m_lat}, lon:${m_lon}"$) Log($"Coordenadas de la tienda - lat:${m_lat}, lon:${m_lon}"$)
l2.Initialize2(m_lat, m_lon) l2.Initialize2(m_lat, m_lon)
BT_QR.Enabled = True BT_QR.Enabled = True

View File

@@ -122,7 +122,7 @@ Sub MapFragment1_Ready
'permisos 'permisos
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION) rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean) Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
gmap.MyLocationEnabled = Result gmap.MyLocationEnabled = Result
Dim JavaMapsObject As JavaObject Dim JavaMapsObject As JavaObject

View File

@@ -181,7 +181,7 @@ Version=12.8
#Region Project Attributes #Region Project Attributes
#ApplicationLabel: Salma Venta #ApplicationLabel: Salma Venta
#VersionCode: 1 #VersionCode: 1
#VersionName: 4.08.26 #VersionName: 4.12.09
'SupportedOrientations possible values: unspecified, landscape or portrait. 'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait #SupportedOrientations: portrait
#CanInstallToExternalStorage: False #CanInstallToExternalStorage: False

View File

@@ -58,12 +58,12 @@ ModuleClosedNodes2=4,9
ModuleClosedNodes20=39,46 ModuleClosedNodes20=39,46
ModuleClosedNodes21= ModuleClosedNodes21=
ModuleClosedNodes3= ModuleClosedNodes3=
ModuleClosedNodes4=1,3,5 ModuleClosedNodes4=1
ModuleClosedNodes5= ModuleClosedNodes5=
ModuleClosedNodes6= ModuleClosedNodes6=
ModuleClosedNodes7= ModuleClosedNodes7=
ModuleClosedNodes8= ModuleClosedNodes8=
ModuleClosedNodes9= ModuleClosedNodes9=
NavigationStack=C_Principal,JobDone,1527,6,B4XMainPage,i_engrane_Click,602,0,Starter,Process_Globals,14,0,Main,Process_Globals,21,0,Main,Globals,25,0,C_Principal,b_mapa_Click,1681,0,C_Principal,Class_Globals,223,0,C_Principal,B4XPage_Appear,304,3,C_Principal,connecta_Click,1622,6,B4XMainPage,B4XPage_Appear,243,3 NavigationStack=Tracker,CreateLocationRequest,115,0,B4XMainPage,B4XPage_Appear,250,0,B4XMainPage,copiaDB,561,0,MAPA_RUTAS,MapFragment1_Ready,118,0,C_Cliente,GPS_LocationChanged,492,6,C_Cliente,B4XPage_Appear,475,6,Tracker,CreateLocationRequestSmallD,132,0,Main,Activity_PermissionResult,52,0,Main,Globals,23,0,Tracker,flp_LocationChanged,190,0,Starter,ENVIA_ULTIMA_GPS,74,0
SelectedBuild=0 SelectedBuild=0
VisibleModules=19,2,20,12,13,4,21,17 VisibleModules=19,2,20,12,13,4,21,1,18

View File

@@ -78,7 +78,7 @@ Sub Service_Destroy
End Sub End Sub
Sub ENVIA_ULTIMA_GPS Sub ENVIA_ULTIMA_GPS
LogColor("Iniciamos ENVIA_ULTIMA_GPS", Colors.Magenta) LogColor("Salma - Iniciamos ENVIA_ULTIMA_GPS", Colors.Magenta)
Dim cmd As DBCommand Dim cmd As DBCommand
' cmd.Initialize ' cmd.Initialize
' cmd.Name = "select_fechat" ' cmd.Name = "select_fechat"

View File

@@ -159,7 +159,7 @@ End Sub
Sub flp_LocationChanged (Location1 As Location) Sub flp_LocationChanged (Location1 As Location)
' ToastMessageShow("Loc changed", False) ' ToastMessageShow("Loc changed", False)
' Log($"Loc changed:${Location1.Longitude},${Location1.Latitude}"$) ' LogColor($"Loc changed:${Location1.Longitude},${Location1.Latitude}"$, Colors.red)
B4XPages.MainPage.lat_gps = Location1.Latitude B4XPages.MainPage.lat_gps = Location1.Latitude
B4XPages.MainPage.lon_gps = Location1.Longitude B4XPages.MainPage.lon_gps = Location1.Longitude
UUGCoords = Location1 UUGCoords = Location1
@@ -184,7 +184,7 @@ Sub flp_LocationChanged (Location1 As Location)
'/////// '///////
Dim coords As String = Location1.Latitude&","&Location1.Longitude&","&formatoFecha(Location1.Time) Dim coords As String = Location1.Latitude&","&Location1.Longitude&","&formatoFecha(Location1.Time)
' Log("Loc changed : "&Location1.Latitude&","&Location1.Longitude&"|"&B4XPages.MainPage.usuario&"|") ' Log("Loc changed : "&Location1.Latitude&","&Location1.Longitude&"|"&B4XPages.MainPage.usuario&"|")
Log("Mandamos Ubicacion") ' Log("Mandamos Ubicacion")
' Log(FirebaseMessaging.locRequest) ' Log(FirebaseMessaging.locRequest)
' Solo mandamos la ubicacion si la precision es menor a XX mts ' Solo mandamos la ubicacion si la precision es menor a XX mts
' If Location1.Accuracy < 100 Then ' If Location1.Accuracy < 100 Then
@@ -194,8 +194,9 @@ Sub flp_LocationChanged (Location1 As Location)
B4XPages.MainPage.cliente.LA_GPS.Text = "CON UBICACION GPS" B4XPages.MainPage.cliente.LA_GPS.Text = "CON UBICACION GPS"
B4XPages.MainPage.cliente.LA_GPS.TextColor = Colors.blue B4XPages.MainPage.cliente.LA_GPS.TextColor = Colors.blue
End If End If
LogColor(Location1.Latitude, Colors.red) ' LogColor(Location1.Latitude, Colors.red)
CallSub2(Starter, "GPS_LocationChanged", Location1) CallSub2(Starter, "GPS_LocationChanged", Location1)
' CallSub2(B4XPages.MainPage.cliente, "GPS_LocationChanged", Location1)
' CallSub2(gestion, "GPS_LocationChanged", Location1) ' CallSub2(gestion, "GPS_LocationChanged", Location1)
' CallSub2(B4XPages.GetPage("Cliente"), "GPS_LocationChanged", Location1) ' CallSub2(B4XPages.GetPage("Cliente"), "GPS_LocationChanged", Location1)
' CallSub2(nuevocliente, "GPS_LocationChanged", Location1) ' CallSub2(nuevocliente, "GPS_LocationChanged", Location1)