Checking Internet connection in Android
Is there any background task which runs with in application to check for internet connectivity for below scenarios as common ? 1.Start of parsing/fetching data from server 2.In between of parsing/fetching from server Any sample code or links helps me a lot. You can start an IntentService or Service and use this: public boolean CheckInternet() { ConnectivityManager connec = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); android.net.NetworkInfo wifi = connec.getNetworkInfo(ConnectivityManager.TYPE_WIFI); android.net.NetworkInfo mobile = connec.getNetworkInfo