Question

I am interested in opening the Google Navigator app from inside an application I am writing. I want to be able to spawn it at a given time and pass specific data into it.

Can anyone think of a good way for me to do this? What permissions do I need, etc? Thank you very much.

Was it helpful?

Solution

You are looking for intents. These are messages you throw up to the system that allow the appropriate action to be taken, such as opening another application.

Here is a guide to using Intents and Intent Filters.

In particular, here is a page that discusses the intents you should use for Google's applications, including Google Maps.

Also, see here for a similar question asked on Google's forum.

A sample of example code that works is as follows:

Intent i = new Intent(Intent.ACTION_VIEW, 
Uri.parse("google.navigation:q=New+York+NY)); 
startActivity(i); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top