google Directions API
I read this guide now I can build a correct request to receive the xml file containg the directions from address A to address B. What I need is
I was also trying to use the Direction Api of Google in Android. So I made an open source project to help doing that. You can find it here:https://github.com/MathiasSeguy-Android2EE/GDirectionsApiUtils
How it works, definitly simply:
public class MainActivity extends ActionBarActivity implements DCACallBack{
/**
* Get the Google Direction between mDevice location and the touched location using the Walk
* @param point
*/
private void getDirections(LatLng point) {
GDirectionsApiUtils.getDirection(this, startPoint, endPoint, GDirectionsApiUtils.MODE_WALKING);
}
/*
* The callback
* When the directions 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);
}
}