Android examples for android.net:ConnectivityManager
is Mobile Data Enable
import android.content.Context; import android.net.ConnectivityManager; public class Main { public static boolean isMobileDataEnable(Context context) throws Exception { ConnectivityManager connectivityManager = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); boolean isMobileDataEnable = false; isMobileDataEnable = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).isConnectedOrConnecting(); return isMobileDataEnable; }//from ww w.j a va 2s . c o m }