Get driving directions using Google Maps API v2

Anukool picture Anukool · Jan 24, 2013 · Viewed 110.5k times · Source

I am trying to get the driving direction between the two positions:

LatLng(12.917745600000000000,77.623788300000000000)
LatLng(12.842056800000000000,7.663096499999940000)

The code which i have tried:

Polyline line = mMap.addPolyline(new PolylineOptions().
    add(new LatLng(12.917745600000000000,77.623788300000000000),
    new LatLng(12.842056800000000000,7.663096499999940000))
       .width(5).color(Color.RED));

But this draws a straight line between the two points .

Is there any other method/way to get the driving directions between these two points.

Answer

Akexorcist picture Akexorcist · Feb 24, 2013

I just release my latest library for Google Maps Direction API on Android https://github.com/akexorcist/Android-GoogleDirectionLibrary