Code example for NetworkInfo

Methods: getExtraInfo, getReason, getState, getSubtype, getSubtypeName, getType, getTypeName, isAvailable, isConnected, isConnectedOrConnecting

0
			ConnectivityManager __cm = (ConnectivityManager) _context.getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
			NetworkInfo __activityNet = __cm.getActiveNetworkInfo();
//			NetworkInfo __mobileNet = __cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); 
//			NetworkInfo __wifiNet = __cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI); 
			FREObject __obj = FREObject.newObject("Object", null);
			__obj.setProperty("state", FREObject.newObject(__activityNet.getState().toString()));
			__obj.setProperty("type", FREObject.newObject(__activityNet.getType()));
			__obj.setProperty("typeName", FREObject.newObject(__activityNet.getTypeName()));
			__obj.setProperty("extraInfo", FREObject.newObject(__activityNet.getExtraInfo()));
			__obj.setProperty("reason", FREObject.newObject(__activityNet.getReason()));
			__obj.setProperty("subType", FREObject.newObject(__activityNet.getSubtype()));
			__obj.setProperty("subTypeName", FREObject.newObject(__activityNet.getSubtypeName()));
			__obj.setProperty("isAvailable", FREObject.newObject(__activityNet.isAvailable()));
			__obj.setProperty("isConnected", FREObject.newObject(__activityNet.isConnected()));
			__obj.setProperty("isConnectedOrConnecting", FREObject.newObject(__activityNet.isConnectedOrConnecting()));
			return __obj;
		} 
		catch(Exception $e)
		{ 
			_context.dispatchStatusEventAsync($e.getMessage(), TAG);
		}