mirror of
https://github.com/KeymonSoft/Monitor-Keymon.git
synced 2026-04-17 21:06:19 +00:00
- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user