How to draw route directions google maps API V2 from current location to destination Android

Fetching Comments ...

How to draw route directions google maps API V2 from current location to destination Android

First we will hit google directions url using our start and end latitute and longitude. After that we will read xml content on that webpage and parse in our app using xml parser. And then we will fetch list of latitude and longitude from that webpage and display on google map on android.

below is code:

After creating above file you can use below methods to get locations and display on google map.

The sourcePosition, destPosition are from the LatLng type, and you give them the wanted points.

LearnPainLess On Instagram

Get The Best Of All Hands Delivered To Your Inbox

Subscribe to our newsletter and stay updated.