Folks, any suggestion on why I am receiving "REQUEST_DENIED" xml response when I use the google direction API web services from my android code. Nothing fancy here:- String hosturl="https://maps.googleapis.com/maps/api/directions/xml?"; String url = "origin=" +lat1 + " " + lon1 + "&destination=" + lat2 + " " + lon2 + "&sensor=true"; String tag[] = { "lat", "lng" }; ArrayList<GeoPoint> list_of_geopoints = new ArrayList<GeoPoint>(); HttpResponse response = null; try { HttpClient httpClient = new DefaultHttpClient(); HttpContext localContext = new BasicHttpContext(); String newurl = URLEncoder.encode(url, "UTF-8"); String finalurl = hosturl + newurl; System.out.println(" Direction request going out:"+ finalurl); HttpPost httpPost = new HttpPost(finalurl); try{ response = httpClient.execute(httpPost, localContext); } catch (Exception exc){ System.out.println("IO Exeception in making direction request: "+ exc.getMessage()); //list_of_geopoints=null; return list_of_geopoints; } InputStream in = response.getEntity().getContent(); DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(in); if (doc != null) { NodeList nl1, nl2, statusList; statusList = doc.getElementsByTagName("status");
when I print the status node, I get a REQUEST_DENIED. I see that others have also posted the same but did not get any response. I already have a key for my MAP API. However, I am not using the latest Google Places API as I believe I do not need to. I am completely clueless. I am making the app using Android 3.2 while running it on my HTC 1x which uses 4.1.1 My Map rendering is working and so is also my location details. However I am trying to show the direction btw 2 Geopoints. Any advice will be greatly appreciated. 2 days of frustration - I am sure it will be something very simple. thanks Sunny -- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.