How can i check using B4a for existence of internet because current iam using data on my phone to connect to the internet i wanted a function which can check whether there is no internet despite the fact that it is still connected
iam currently using this but even when i run out internet it does not show please help
iam currently using this but even when i run out internet it does not show please help
B4X:
Sub IsConnectedToInternet As Boolean
Dim r As Reflector
r.Target = r.GetContext
r.Target = r.RunMethod2("getSystemService", "connectivity", "java.lang.String")
r.Target = r.RunMethod("getActiveNetworkInfo")
If r.Target <> Null Then
Return r.RunMethod("isConnectedOrConnecting")
End If
Return False
End Sub