This project allows you to calculate the direction between two locations and display the route on a Google Map using the Google Directions API.

This project isn't actively been maintained.



Grab via Maven:


or Gradle:

    compile 'com.github.jd-alexander:library:1.1.0'


To calculate the route you simply instantiate a Routing object and trigger the execute function.

*You can execute the task in this manner. ( See the example for more details on the exact implementation)

        Routing routing = new Routing.Builder()
                    .travelMode(/* Travel Mode */)
                    .withListener(/* Listener that delivers routing results.*/)
                    .key(/*api key for quota management*/)

actual code

        start = new LatLng(18.015365, -77.499382);
        waypoint= new LatLng(18.01455, -77.499333);
        end = new LatLng(18.012590, -77.500659);
        Routing routing = new Routing.Builder()
                    .waypoints(start, waypoint, end)
    public void onRoutingSuccess(ArrayList<Route> route, int shortestRouteIndex)
       //code to add route to map here. See sample app for more details.

Known Issues

  • If the AutoComplete TextView/Map of the sample app isnt working then probably the API key hasn't been set in the manifest.

  • If the route is not being displayed then type "Routing" in your log cat to see the potential error messages from the library.


Please fork repository and contribute using pull requests.

Any contributions, large or small, major features, bug fixes, additional language translations, unit/integration tests are welcomed and appreciated but will be thoroughly reviewed and discussed.