14
September
2013
Hi all
I was putting in place a conference on GoogleMap V2 for Android when I wanted to display the route between two points. For this he must use the Rest Google service called Direction https://developers.google.com/maps/documentation/directions/, retrieve the data, the parser and display.
It is rather tedious, so I searched for a project doing it already. And I have not found, so I did. It is located on GitHub: GDirectionsApiUtils.
Thus the GDirectionsApiUtils project allows you to ultra easy to implement this functionality within your application.
How it works, download the jar (gdirectionsapiutils.jar in the bin folder) and place the in the your project libs folder. Then you've more to use it:
/**
* Get the Google Direction between mDevice rental and the touched rental using the Walk
* @param point
*/
Private Sub getDirections (point LatLng) {}
GDirectionsApiUtils.getDirection (mDcaCallBack, startPoint, endPoint, GDirectionsApiUtils.MODE_WALKING);
}
/*
* The callback
* When the direction is built from the google server and parsed, this method is called and give you the expected direction
*/
@Override
public void onDirectionLoaded (List directions) {}
Display the direction or use the DirectionsApiUtils
for(GDirection direction:directions) {}
Log.e("MainActivity", "onDirectionLoaded: Draw GDirections Called with path" + directions);
GDirectionsApiUtils.drawGDirection (direction, mMap);
}
}
Rotate the information around you, I'm sure that an Android developer will be happy.
And more if you want to improve the project, it is with pleasure that I expect a helping hand, I asked the base, but is not added flourishes that would be the welcome
Mathias Séguy
This email address is being protected from spambots. You need JavaScript enabled to view it.
Founder Android2EE
Training - Expertise - Consulting Android.
EBooks learn programming Android.
Find me on Google +.
Follow me on Twitter
Join my LinkedIn network or Viadeo
You must be connected to post a comment.