Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Launching Google Navigation from an app

Tags:

I am currently in progress of an android app, which takes some coordinates by the user (Starting point from gps and destination defined by the user)

I would like my app to launch the google navigation so that it can guide the user through these points. At a next step, I would like to give navigation more points (eg some points of interest) so that it will guide the user through a specific route containing all the points.

Is that possible? All that I find is no-documented practices and no examples. Is there anyone who has solved this problem? If not, can someone suggest some other navigation programm?

Thank you in advance, George

like image 673
george Avatar asked Dec 19 '11 09:12

george


1 Answers

You can certainly guide them to a single point:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" +mLat+","+mLong));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);

Not sure about setting way points might be some way to do it, I think the API is undocumented so use at your own risk. You could have your app in the background listening to the GPS information and have it prompt the user at certain points.

like image 54
stealthcopter Avatar answered Oct 16 '22 23:10

stealthcopter