Code example for NetworkInfo

Methods: getSubtype, isConnected

0
			mOnline = true;
		} else { 
			if (mMobile) {
				/* if mobile is active and EDGE or better, we're good */ 
				ni = mCmgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
				if (ni != null && ni.isConnected()) {
					mOnline = (ni.getSubtype() >= TelephonyManager.NETWORK_TYPE_EDGE);
				} 
			} 
		} 
		return mOnline;
	} 
 
	static public boolean updateNotification(Context context) {
 
		// check the current system status 
		checkConnectivity(context);
 
		// clicking this will open the prefs pane 
		// PendingIntent pi = PendingIntent.getActivity(context, 0, 
		//		new Intent(context, ENUMPrefs.class), 0);