I want make a application that work with Internet and a Server and Web service, I create a method to check network available, I use bellow method:
private boolean isNetworkConnect() {
ConnectivityManager cm = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo netinfo = cm.getActiveNetworkInfo();
if (netinfo != null && netinfo.isConnected()) {
netType = netinfo.getTypeName();
return true;
} else {
return false;
}
}
This method just specify that WiFi of Mobile network in Android is Enable or Disable, But this is not sufficient to Internet Access, because if I disable my Laptop WiFi, but my android app in Emulator said Internet in Access because WiFi or Mobile Network is Enable, But if open browser and search any sites is not Access.!
I How to check internet access, that I search on browser, read from server and others. What is best solution ?