Does someone know accordind to what google maps choosing the Driving Directions?
Fast roads and things like that...
I'm using in my app google maps v2 directions and I want to know according to what it coosing the directions.
According to Google you can just avoid highways, ferries and tolls. You can also choose the mode, but not 'fast roads'.
For example:
http://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&sensor=false&key=API_KEY&avoid=highways&mode=driving
For your application you can do this:
String url = "http://maps.googleapis.com/maps/api/directions/xml?origin=Toronto&destination=Montreal&sensor=false&key=API_KEY&avoid=highways&mode=driving";
HttpGet httpGet = new HttpGet(url);
HttpClient httpClient = new DefaultHttpClient();
HttpResponse httpResponse;
try {
httpResponse = httpClient.execute(httpGet);
HttpEntity httpEntity = httpResponse.getEntity();
InputStream inputStream = httpEntity.getContent();
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(inputStream);
//In doc is your response
} catch (Exception e) {
e.printStackTrace();
}