Sub Globals
Public PhoneEvent1 As PhoneEvents
End Sub
Sub PhoneEvent_ConnectivityChanged(NetworkType As String, State As String, Intent As Intent)
'NetworkType - WIFI or MOBILE.
'State - One of the following values: CONNECTING, CONNECTED, SUSPENDED, DISCONNECTING, DISCONNECTED, UNKNOWN.
If State = "CONNECTED" Then
internetConnectionStatus(False,"")
Starter.internet_connected=True
Else
internetConnectionStatus(True,"No Internet. Connect Wi-Fi or Mobile Network")
Starter.internet_connected=False
Starter.mqttConnected=False
End If
Sub internetConnectionStatus(flag As Boolean,message As String)
Try
pnlInternet.Visible=flag
pnlInternet.BringToFront
lblConnection.Text=message
Catch
Log(LastException)
End Try
End Sub