Skip to content
MathiasSeguy-Android2EE edited this page Sep 13, 2013 · 13 revisions

To install the project, you need to add the Google Service to it. It's exactly the same way you've done that for your own project when installing GoogleMap. Because this project needs to know GoogleMap. Then compile.

In your own Project, import it as a librairy, copy/paste the gdirectionsapiutils.jar from GDirectionsApiUtils/bin/ to your libs project. As usual, link the eclipse project to your project and add the librairy in the android part (still in the build path).

Ok, compile, and then use it to retrieve direction between two points: ` 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, mDeviceLatlong, point, GDirectionsApiUtils.MODE_WALKING); }

/*
 * (non-Javadoc)
 * 
 * @see
 * com.android2ee.formation.librairies.google.map.direction.DCACallBack#onDirectionLoaded(com
 * .android2ee.formation.librairies.google.map.direction.GDirection)
 */
@Override
public void onDirectionLoaded(List<GDirection> 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);
	}
}`
Clone this wiki locally