Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting navigation in Waze with Android's Intents

I have a simple Android app which should be able to allow navigation between 2 GeoPoint's.

I can easily display a GeoPoint on Waze, writing this small piece of code:

String uri = "waze://?ll=40.761043, -73.980545&z=10";
startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri)));

But, what I really need is a way to display navigation directions between 2 points. I've tried to locate the correct BroadcastReciever in the Waze source, but I stopped follow when it got to native calls (JNI) because I have no idea where the actual call is... I reached only to the URIHandler signature, with no success finding the implementation...

Any ideas?

Thanks.

like image 400
ofirbt Avatar asked Jan 10 '12 16:01

ofirbt


People also ask

How do I navigate to a specific location in Waze live?

To navigate to a specific location: Open the Waze Live Map and search for your location. Either type in the search box or zoom in and click on a specific segment of the map. Click the share icon in the bottom-right corner of the map. A dialog appears. Click Share driving directions, then copy and paste the link.

How does the Waze app work?

The Waze application can then locate an address, mark an address on the map, or start a navigation session to an address or destination, based on which parameters you pass to this URL. Whether Waze opens as a client app or a web page depends on the user's system configuration:

What is the difference between Waze and Google Maps?

Now, for two of the selected apps (Waze and HERE WeGo), we can only navigate from where we are to a destination point, whereas in Google Maps you can set it up to navigate from any place (even if you’re not there) to any intended destination. Let’s start by adding the code for Waze.

How do you add latitude and longitude to a Waze map?

We take the URL that Waze knows how to handle, put the latitude and longitude where they should inside it; then, we launch an intent and wait for the intent app chooser to show Waze (if it’s installed in the phone) and select it. That’s it.


3 Answers

Fix you uri to:

String uri = "waze://?ll=40.761043, -73.980545&navigate=yes";

(added navigate=yes) and you should be good.

like image 200
TalL Avatar answered Nov 09 '22 09:11

TalL


If this is still relevant you can use this:

String uri = "geo: latitude,longtitude";
startActivity(new Intent(android.content.Intent.ACTION_VIEW,
                        Uri.parse(uri)));
like image 29
Ami Avatar answered Nov 09 '22 08:11

Ami


Today's Waze base url is https://waze.com/ul so to navigate you have to use

https://waze.com/ul?ll=45.6906304,-120.810983&navigate=yes
like image 22
Claudio Redi Avatar answered Nov 09 '22 10:11

Claudio Redi