3

In javascript, using Google maps apis we specify options such as google.maps.TravelMode.DRIVING. Do we have any equivalent for TravelMode in android? I couldn't see anything in android.location.LocationManager or android.location.Criteria I've thought of following options:

  1. Using some TravelMode alternative, get coordinates approximated to nearest street/road.

  2. Alternatively, (Not preferred as it will be slow) get the coordinates normally and then probably send it to some google api(This will be pretty slow as there are many points) and get the coordinates corrected to the nearest street coordinates. Or in case if there exists some (google-maps) javascript framework, it may be used to get corresponding street coordinates.

Edit1:

I've also looked into this. and hence into android.location.Geocoder. The getFromLocation in this class seems to do most of the work. However, I'm afraid, of an additional delay while acquiring the nearest address.

Community
  • 1
  • 1
ranjjose
  • 2,138
  • 1
  • 24
  • 46
  • 3
    Have you asked this question before and it was closed? – MaciejGórski Sep 04 '13 at 06:53
  • 2
    @MaciejGórski Yes, I had asked another question which was closed. Stackoverflow suggested to edit the question. I did that by changing that question significantly. However since it was closed, and as I was not getting any answer, I thought of asking a new question. And hence this. – ranjjose Sep 04 '13 at 06:56

1 Answers1

5

If you are referring to Directions Service, then it uses Google Directions API internally as stated in the overview:

This object communicates with the Google Maps API Directions Service which receives direction requests and returns computed results.

As there is no native API for Android yet, I suggest using Directions API directly.

See my answer here.

Community
  • 1
  • 1
MaciejGórski
  • 22,187
  • 7
  • 70
  • 94