Search code examples
androidgoogle-mapsandroid-studiogoogle-maps-api-2

Distance/Time beetween two points in android google maps


I want to create a simple app that determines the distance and the time to go to some location. The problem is I don't find really good documentation of google maps api v2 in android.

I already have a map and two location marked with a marker. I tried to draw the path between them but I get a straight line and it's not logic for a user who will go to somewhere.

1) Is there any official documentation of google map Api V2?

2) Are there functions that determine location between two points and we can, for example, change the path by dragging (like in google maps site)? Or I must use external class programmed by users?


Solution

  • you will need to look into this link for distance between 2 locations and time

    https://developers.google.com/maps/documentation/directions/

    Basically, you will need to make http call to the google map service which returns JSON with everything you mentioned above, sort your JSON into readable text to use in java