I am facing the issue,
Wifi is connected but internet is not there.
How to check that??
Please somebody help.
I am facing the issue,
Wifi is connected but internet is not there.
How to check that??
Please somebody help.
You can use ConnectivityManager
to detect it:
WifiManager wm = (WifiManager) Context.getSystemService(WIFI_SERVICE);
WifiInfo niWifi = wm.getConnectionInfo();
SupplicantState supState = niWifi.getSupplicantState();
if(supState == SupplicantState.COMPLETED) {
// internet is working
}
I'm not 100% sure, but I think that other than checking your Wifi interface if it is up and running, you can't actually know if you are connected to Internet. If your need is just to check if everything is up and running, you could try to retrieve a page (ex: www.google.com ) and be prepared to catch an exception if it's going to fail.
Feel free to tell me I'm an idiot ^_^"