Here you can find the source of isConnectedMobile(Context context)
public static boolean isConnectedMobile(Context context)
//package com.java2s; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class Main { public static boolean isConnectedMobile(Context context) { NetworkInfo info = getNetworkInfo(context); return isConnected(info) && info.getType() == ConnectivityManager.TYPE_MOBILE; }/* ww w .j av a2s .co m*/ public static NetworkInfo getNetworkInfo(Context context) { ConnectivityManager cm = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); return cm.getActiveNetworkInfo(); } public static boolean isConnected(Context context) { NetworkInfo info = getNetworkInfo(context); return isConnected(info); } public static boolean isConnected(NetworkInfo info) { return info != null && info.isConnected(); } }