3

I need to send an intent to Waze app in Android to navigate to a UK postcode like "N3 2AL"

I did it before with google map using this piece of code and works fine:

String postcode = "N3 2AL";
postcode = postcode.trim().replaceAll(" ", "+");
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + postcode));
startActivity(i);

But I can not handle it using Waze:

postcode = postcode.trim().replaceAll(" ", "%20");
Intent i = new Intent(Intent.ACTION_VIEW,
Uri.parse("waze://?q=" + postcode + "&navigate=yes"));
startActivity(i);

I tried using complete link too:

https://waze.com/ul?q=N3%202AL

I assumed waze can not handle UK postcodes, but when I search directly in waze app, it can find the postcode and shows it correctly. The problem is with api.

EDIT: Currently I have to reverse the postcode using postcodes.io and use Waze like this:

waze://ll=lat,long&navigate=yes

It's working but with 1 more server call.

Arash
  • 825
  • 2
  • 11
  • 19
  • have you tried without the space? – Barns Jul 15 '18 at 15:08
  • @Barns yes, same result. Currently I have to reverse the postcode using [postcodes.io](http://postcodes.io), and change the uri to: **waze://?ll=lat,lng&navigate=yes** – Arash Jul 16 '18 at 11:10

0 Answers0