Android: Launch Google Maps App
I saw in another Stack Overflow post you can open the Google maps appl开发者_JAVA百科ication 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?
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.
精彩评论