Code example for NetworkInfo

Methods: getSubtype, isAvailable, isConnected

0
    } 
 
    public boolean isData3GUp() { 
        ConnectivityManager connectivityManager = getConnectivityManager();
        NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
        return networkInfo != null && networkInfo.isAvailable() && (networkInfo.getSubtype() == NETWORK_TYPE_UMTS || networkInfo.getSubtype() == NETWORK_TYPE_EVDO_B) && networkInfo.isConnected();
    } 
 
    public boolean isDataWIFIUp() { 
        ConnectivityManager connectivityManager = getConnectivityManager();
        NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
        return networkInfo != null && networkInfo.isAvailable() && networkInfo.isConnected();
    } 
 
    public boolean isDataWiMAXUp() { 
        ConnectivityManager connectivityManager = getConnectivityManager();
        NetworkInfo networkInfo = connectivityManager.getNetworkInfo(TYPE_WIMAX);
        return networkInfo != null && networkInfo.isAvailable() && networkInfo.isConnected();
    } 
 
    public boolean isData4GUp() {