- VERSION 4.12.11

- Se volvio a incluir la libreria de intercepcion de notificaciones (ReplyAuto) para ayudar a mantener activa la aplicacion.
- Su gregaron bloques de try/catch para evitar que se generen errores cuando los servicios modifican la pantalla principal (mainpage) y la aplicacion esta en segundo plano.
This commit is contained in:
Jose Alberto Guerra Ugalde
2024-12-11 06:16:22 -06:00
parent 2a8bfcc967
commit baa8f9bbd8
7 changed files with 196 additions and 180 deletions

View File

@@ -449,32 +449,36 @@ End Sub
Sub ping
Private ph As Phone
Wait For (ph.ShellAsync("ping", Array As String("-c 1","-W 5", "8.8.8.8"))) Complete (Success As Boolean, ExitValue As Int, StdOut As String, StdErr As String)
If Success Then
Try
If Success Then
' Log("ExitValue:" & ExitValue)
' Log("StdError:" & StdErr)
Private res() As String = Regex.Split(",", StdOut)
For i = 0 To res.Length - 1
If res(i).Contains("1 received") Then
If Starter.logger Then LogColor(">>> HAY CONEXION", Colors.Green)
Starter.ping = True
Else If res(i).Contains("0 received") Then
If Starter.logger Then LogColor(">>> NO HAY CONEXION", Colors.Red)
Starter.ping = False
End If
Private res() As String = Regex.Split(",", StdOut)
For i = 0 To res.Length - 1
If res(i).Contains("1 received") Then
If Starter.logger Then LogColor(">>> HAY CONEXION", Colors.Green)
Starter.ping = True
Else If res(i).Contains("0 received") Then
If Starter.logger Then LogColor(">>> NO HAY CONEXION", Colors.Red)
Starter.ping = False
End If
' Log(res(i))
Next
Next
' LogColor("StdOut: " & res, Colors.Blue)
If B4XPages.IsInitialized Then B4XPages.MainPage.cb_internet.Checked = Starter.ping
If Not(Starter.ping) Then
If Starter.logger Then Log("Sin conexión a Google!!!")
notiLowReturn("SIN INTERNET ❌", "NO hay conexion a Google.", Monitor.nid)
Dim cs As CSBuilder
cs.Initialize
If B4XPages.IsInitialized Then B4XPages.MainPage.l_status.Text = cs.Color(Colors.red).append("NO hay conexión a Google!!").PopAll
If B4XPages.IsInitialized Then B4XPages.MainPage.cb_internet.Checked = Starter.ping
If Not(Starter.ping) Then
If Starter.logger Then Log("Sin conexión a Google!!!")
notiLowReturn("SIN INTERNET ❌", "NO hay conexion a Google.", Monitor.nid)
Dim cs As CSBuilder
cs.Initialize
If B4XPages.IsInitialized Then B4XPages.MainPage.l_status.Text = cs.Color(Colors.red).append("NO hay conexión a Google!!").PopAll
End If
Else
Log("Error: " & LastException)
End If
Else
Log("Error: " & LastException)
End If
Catch
Log(LastException)
End Try
End Sub
Sub traeServidorDesdeBD(id As Int) As Map