Android examples for android.net:ConnectivityManager
is Connected Mobile Network
import android.content.Context; import android.net.ConnectivityManager; public class Main { public static boolean isConnectedMobileNetwork() { boolean kResult = false; try {/*from ww w . j av a 2s.com*/ ConnectivityManager connectivityManager = (ConnectivityManager) ContextUtil.CONTEXT .getSystemService(Context.CONNECTIVITY_SERVICE); kResult = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).isConnected(); } catch (Exception e) { e.printStackTrace(); } return kResult; } }