Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class Main { public static boolean isFastDownload(Context ctx) { ConnectivityManager mgrConn = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE); return mgrConn.getActiveNetworkInfo() != null && mgrConn.getActiveNetworkInfo().getState() == NetworkInfo.State.CONNECTED; // TelephonyManager mgrTel = (TelephonyManager) // ctx.getSystemService(Context.TELEPHONY_SERVICE); // || mgrTel.getNetworkType() == TelephonyManager.NETWORK_TYPE_UMTS) { } }