Code example for ConnectivityManager

Methods: requestRouteToHost

0
		return true; 
	} 
 
	@Override 
	public boolean getRouteToPathExists(final int hostAddress) {
		return (mConnectionManager.requestRouteToHost(
				ConnectivityManager.TYPE_WIFI, hostAddress) || mConnectionManager
				.requestRouteToHost(ConnectivityManager.TYPE_MOBILE,
						hostAddress));
	} 
 
	@Override 
	public boolean getWiFiNetworkAvailable() { 
		try { 
			final NetworkInfo wifi = mConnectionManager
					.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
			return wifi != null && wifi.isAvailable();
		} catch (final Exception e) {
		} 
		return false; 
	}