if( wifi.getWifiState() != wifi.WIFI_STATE_ENABLED && prefs.getString( "connection", "" ).equals( CON_WIFI ) ) {
return false;
}
// get connectivity manager
ConnectivityManager manager = (ConnectivityManager) context.getSystemService( Context.CONNECTIVITY_SERVICE );
// check if we have active network and that network is connected, if not abort
if( manager.getActiveNetworkInfo() == null || !manager.getActiveNetworkInfo().isConnected() ) {
return false;
}
// we can use the internet connection
return true;