I would like my app to check for an internet connection. I have only seen threads which are over a year old on this topic. I have been told that a new thread should be started when that is so.
I have just tried:
But it always gives myPhone.GetDataState as "DISCONNECTED" and myDevice.Connected as False. How should this be coded? It would be nice to see the corrected coding including a test to see if the device is a phone or a tablet.
I have just tried:
B4X:
myDevice.Initialize("")
If myPhone.GetDataState.EqualsIgnoreCase("CONNECTED") _
Or myDevice.Connected Then
ToastMessageShow("Internet Connected", True)
Else
ToastMessageShow("Internet Not Connected", True)
ToastMessageShow("myPhone.GetDataState="&myPhone.GetDataState, True)
ToastMessageShow("myDevice.Connected="&myDevice.Connected, True)
End If
But it always gives myPhone.GetDataState as "DISCONNECTED" and myDevice.Connected as False. How should this be coded? It would be nice to see the corrected coding including a test to see if the device is a phone or a tablet.
Last edited: