Question

I saw in another Stack Overflow post you can open the Google maps application from your application by passing two address as parameters in the URL.

String url = "http://maps.google.com/maps?saddr=some+address&daddr=another+Address"
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,  Uri.parse(url));

How can you start the Google maps application from your app and get directions from your current location to an address?

Was it helpful?

Solution

Absolutely, but you'll have to grab your location via GPS coordinates first. Or, just set the position of the second location and let the user tap it and find directions from their current position using Maps itself.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top