2

I am trying to use Waze to show a point on the map.

This the intent:

String link = geo:?ll=32.26944,34.890442&z=10;
new Intent(Intent.ACTION_VIEW, Uri.parse(link))

Instead of showing the point it puts me in navigation mode. Weird thing is that if I use Google Maps instead then it works ok.

Is this a problem with Waze or my code?

Farshan
  • 437
  • 5
  • 14
theblitz
  • 6,683
  • 16
  • 60
  • 114

3 Answers3

5

As you can see here, they made it simpler:

The following are the available parameters:

search for address:         waze://?q=<address search term>
center map to lat / lon:    waze://?ll=<lat>,<lon>
set zoom (minimum is 6):    waze://?z=<zoom>

Examples:

center map to Ayalon and set zoom to 10     waze://?ll=37.44469,-122.15971&z=10
search for address:                         waze://?q=San%20Jose%20California

And the Android API directly:

The following code snippet example will launch Waze to look for the specified location, if Waze is installed. If Waze is not installed it will open Waze page on the Market application.

try
{
   String url = "waze://?q=Hawaii";
    Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( url ) );
   startActivity( intent );
}
catch ( ActivityNotFoundException ex  )
{
  Intent intent =
    new Intent( Intent.ACTION_VIEW, Uri.parse( "market://details?id=com.waze" ) );
  startActivity(intent);
}
g00dy
  • 6,752
  • 2
  • 30
  • 43
1
String uri = "geo:" + latitude + ","
                    +longitude + "?q=" + latitude
                    + "," + longitude;
startActivity(new Intent(android.content.Intent.ACTION_VIEW,
                    Uri.parse(uri)));

This answer has the advantage of calling all apps that handle this functionality. In phone it shows Google Maps, Google Earth and Waze.

Recomendation: Use ShareActionProvider! It displays the list of all possible apps that handle Geolocation.

Source:This StackOverflow Answer

Community
  • 1
  • 1
zubietaroberto
  • 2,417
  • 3
  • 21
  • 15
0

try to input 32.26944 34.890442 ONLY. Do not use comma in between coordinates