Code example for NetworkInfo

Methods: isConnected, isRoaming

0
		try { 
			netInfo = connectivityManager.getActiveNetworkInfo();
		} catch (SecurityException e) {
			Log.w(TAG, "Connectivity permissions have been removed from AndroidManifest.xml: " + e.getMessage());
		} 
		if (netInfo != null && netInfo.isConnected() && !netInfo.isRoaming()) {
			result = true;
		} 
 
		return result;
	} 
	@Override 
	public IBinder onBind(Intent intent) {
		return null; // Not handling 
	} 
 
}