In the past I checked for an internet connection with Serversocket.GetMyIP.
When it returns 127.0.0.1 the device was not connected.
On my Galaxy Nexus with JB 4.1.1 Serversocket.GetMyIP returns "fe80::2064:32ff:fe5e:9660%p2p0" even if there is no connection. Any ideas why this happens?
I now check with Serversocket.GetMyWifiIP (if it is 127.0.0.1 wifi is not connected) and with Phone.GetDataState (If it is CONNECTED, then data is connected).
Any better ways to check for a valid data connection?
When it returns 127.0.0.1 the device was not connected.
On my Galaxy Nexus with JB 4.1.1 Serversocket.GetMyIP returns "fe80::2064:32ff:fe5e:9660%p2p0" even if there is no connection. Any ideas why this happens?
I now check with Serversocket.GetMyWifiIP (if it is 127.0.0.1 wifi is not connected) and with Phone.GetDataState (If it is CONNECTED, then data is connected).
Any better ways to check for a valid data connection?