Java tutorial
//package com.java2s; import android.net.NetworkInfo.State; import android.content.Context; import android.net.ConnectivityManager; public class Main { public static boolean check3GNetworkInfo(Context context) { try { ConnectivityManager conMan = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); //mobile 3G Data Network State mobile = conMan.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).getState(); return (mobile == State.CONNECTED || mobile == State.CONNECTING); } catch (Exception e) { return false; } } }