Code example for AndroidHttpClient

Methods: getParams

0
 
	private AndroidHttpClient client;
	 
	public GoogleDirectionsProvider() { 
		client = AndroidHttpClient.newInstance(null);
		HttpClientParams.setRedirecting(client.getParams(), true);
	} 
	 
	@Override 
	public Directions getDirections(Location start, Location end) {
		 
		String url = "http://maps.googleapis.com/maps/api/directions/json?origin=";
		StringBuilder builder = new StringBuilder(url);
		builder.append(start.getLatitude() + "," + start.getLongitude());
		builder.append("&destination=" + end.getLatitude() + "," + end.getLongitude());
		builder.append("&sensor=true");
		url = builder.toString();
		Log.d("directions", url);
		 
		HttpGet request = new HttpGet(url);