views:

16

answers:

0

When i am using below url for drawing route on map on android:

StringBuilder urlString = new StringBuilder();   
   urlString.append("http://maps.google.com/maps?f=d&hl=en");  
   urlString.append("&saddr=");  
   urlString.append(src);  
   urlString.append("&daddr=");// to  
   urlString.append(dest);  
   urlString.append("&ie=UTF8&0&om=0&output=kml");

Its throwing exception when urlConnection.getInputStream is called.

HttpURLConnection urlConnection=(HttpURLConnection)url.openConnection();
      urlConnection.setRequestMethod("GET");
      urlConnection.setDoOutput(true);
      urlConnection.setDoInput(true);
      urlConnection.connect(); 

      DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
      DocumentBuilder db = dbf.newDocumentBuilder();
      doc = db.parse(urlConnection.getInputStream());