You could use something like this:
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345"));
startActivity(intent);
You can use an actual street address instead of latitude and longitude.
However this will give the user a dialog to choose between opening it via
browser or Google Maps.
If you are in the US, you could use an unofficial way (Since it isn't
official, I don't recommend using it). This will fire up Google Maps in
navigation mode. Haven't played with it since where I live it isn't
available.
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("google.navigation:q=an+address+city");
If you want to get rid of the dialog you can give the intent a hint as to
which package you want to use.
Before the startActivity() add this:
intent.setClassName("com.google.android.apps.maps",
"com.google.android.maps.MapsActivity");
On Saturday, December 12, 2009 3:18:20 AM UTC+5:30, Declan Shanaghy wrote:
>
> Hello,
> I realize this might not be the proper place to post this since it's not
> Android specific, but rather its about integrating with a google app.
>
> I've been trying to find some documentation on launching / controlling the
> Google Navigation app via Intents or otherwise.
> I was hoping to find an intent to launch the navigation app with address
> parameters setup and start navigation immediately.
>
> Can't find anything out there, so I'm still not even sure if it can be
> done.
>
> Anyone have any ideas?
>
>
> Thanks,
> Dek
>
>
> --
> "An engineer's definition of done is the perfect set of code, and left to
> his own devices, an engineer will endlessly improve the code on the mythic
> journey to done."
> -- http://www.randsinrepose.com
>
> [DS]
>
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en