List of usage examples for android.net NetworkInfo isConnected
@Deprecated public boolean isConnected()
From source file:Main.java
public static boolean isWIFIConnected(Context context) { ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo info = manager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); return info != null && info.isConnected(); }
From source file:Main.java
/** * Returns <tt>true</tt> if the Connections is available. Else returns <tt>false</tt>. * * @return/* w ww . j av a2 s.co m*/ */ public static boolean isConnectedOnline(Context myContext) { ConnectivityManager cmObj = (ConnectivityManager) myContext.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfoObj = cmObj.getActiveNetworkInfo(); return networkInfoObj != null && networkInfoObj.isConnected(); }
From source file:Main.java
/** * is network avaliable/*from www . j a v a 2s . c o m*/ * * @param context * @return */ public static boolean isNetworkAvaliable(Context context) { ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) { return true; } else { return false; } }
From source file:Main.java
public static boolean checkNetwork(Context context) { ConnectivityManager connectivity = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = connectivity.getActiveNetworkInfo(); return (activeNetwork != null && activeNetwork.isConnected()); }
From source file:Main.java
public static boolean isConnectedToWifi(Context ctx) { ConnectivityManager connManager = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); return mWifi != null && mWifi.isConnected(); }
From source file:Main.java
public static boolean isInternetOn(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfol = connectivityManager.getActiveNetworkInfo(); return networkInfol != null && networkInfol.isConnected(); }
From source file:Main.java
public static boolean isWifiAvailable(Activity activity) { ConnectivityManager connManager = (ConnectivityManager) activity .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); return mWifi.isConnected(); }
From source file:Main.java
public static boolean isNetWorkAvailable(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); return networkInfo != null && networkInfo.isConnected(); }
From source file:Main.java
public static boolean checkIfNetworkConnectionAvailable(ConnectivityManager connManager) { boolean isConnected = false; NetworkInfo mWifi = connManager.getActiveNetworkInfo(); if (mWifi != null) isConnected = mWifi.isConnected(); return isConnected; }
From source file:Main.java
public static boolean isHighBandwidthConnection(Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo info = cm.getActiveNetworkInfo(); return (info != null && info.isConnected() && isConnectionFast(info.getType(), info.getSubtype())); }