I am using this to find out if the phone has an Internet connection or not, to android 5.1.1 worked perfectly, but on android 6.0 even without internet connection just returns true, someone has a solution that can be shared.
Thanks.
B4X:
Sub isConnected() As Boolean
Dim sSocket As ServerSocket
If sSocket.IsInitialized = False Then
sSocket.Initialize(8080, "sSocket")
sSocket.Close
End If
If sSocket.GetMyIP = "127.0.0.1" Then
Return False
Else
Return True
End If
End Sub
Thanks.