* @return Can connect to internet or not
*/
@SuppressWarnings( "static-access" )
public boolean canConnect( Context context, SharedPreferences prefs ) {
// get wifi manager
WifiManager wifi = (WifiManager) context.getSystemService( Context.WIFI_SERVICE );
// if wifi is disabled and the user preference only allows wifi abort
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 );