Code example for NetworkInfo

Methods: isConnectedOrConnecting

0
	public boolean isNetworkConnected() { 
		Log.v( TAG, "isNetworkConnected : enter" );
 
		final ConnectivityManager cm = (ConnectivityManager) mContext.getSystemService( Context.CONNECTIVITY_SERVICE );
		final NetworkInfo networkInfo = cm.getActiveNetworkInfo();
		if( networkInfo == null || !networkInfo.isConnectedOrConnecting() ) {
			Log.e( TAG, "isNetworkConnected : exit, no connection found" );
 
			return false; 
		} 
 
		Log.v( TAG, "isNetworkConnected : exit" );
		return true; 
	} 
	 
	public boolean isMasterBackendConnected() { 
		Log.v( TAG, "isMasterBackendConnected : enter" );
 
		if( null == mLocationProfileDaoHelper.findConnectedProfile() ) {
			Log.e( TAG, "isMasterBackendConnected : exit, no backend selected" );