Code example for UnknownHostException

Methods: toString

0
		/* Do the DNS lookup using java.net library. */ 
		InetAddress a;
		try { 
			a = InetAddress.getByName(MENU_SERVER);
		} catch (UnknownHostException uhe) {
			Log.d(HTTP, uhe.toString());
			return false; 
		}	 
		/* Convert a byte array IP address into an integer representation. */ 
		byte[] b = a.getAddress();			 	// aaa.bbb.ccc.ddd
		int ipint = ((b[3] << 24) | 	// ipint bits[32-25] = aaa
					 (b[2] << 16) | 	// ipint bits[24-17] = bbb
					 (b[1] << 8 ) | 	// ipint bits[16- 9] = ccc
					  b[0]		   );	// ipint bits[ 8- 1] = ddd 
		 
		return cm.requestRouteToHost(ni.getType(), ipint);
	} 
	 
	/* Log Keys */ 
	public static final String HTTP 	= "HTTP Request";
	public static final String CACH	    = "File Input";