Sub PingServer As Boolean
Dim bRetVal As Boolean=False
Try
'Case 1
Dim oPhone As Phone
If oPhone.IsAirplaneModeOn=True Then
bRetVal=False
Return(bRetVal)
EndIf
Dim sDeviceIP As String
'Check 4G connectivity
sDeviceIP=myLan.GetMyIP
'Msgbox(sDeviceIP,"IP address")
If sDeviceIP<>"127.0.0.1" Then
bRetVal=True
Return(bRetVal)
EndIf
sDeviceIP=myLan.GetMyWifiIP
If sDeviceIP="127.0.0.1" Then
bRetVal=False
Return(bRetVal)
EndIf
If oPhone.GetSettings("wifi_on")<>1 Then
bRetVal=False
Return(bRetVal)
EndIf
If oPhone.GetDataState="DISCONNECTED" Then
bRetVal=True
Else
bRetVal=False
EndIf
Catch
oError.ShowLastException("Error Ping")
EndTry
Return(bRetVal)
End Sub