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.