0

I have two EditText where user enter two city name I want draw route between two city and distance between them on Google map.

Kaushik
  • 6,150
  • 5
  • 39
  • 54

1 Answers1

0

You can use Google Directions API to get the routes between them.

https://maps.googleapis.com/maps/api/directions/json?origin=Boston,MA&destination=Concord,MA&waypoints=Charlestown,MA|Lexington,MA

Then you can see the accepted answer here of how to encode the "points"-parameter to LatLng's / Polylines.

This should cover your question i guess: Get driving directions using Google Maps API v2

What you need to know to do this: How to do network requests, how to parse JSON, and how to setup a GoogleMap in your app.

Community
  • 1
  • 1
ullstrm
  • 9,812
  • 7
  • 52
  • 83