0
Uri gmmIntentUri = Uri.parse("google.navigation:q=Taronga+Zoo,+Sydney+Australia");

        Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);    
        mapIntent.setPackage("com.google.android.apps.maps"); 
        startActivity(mapIntent);

It code for 2 points and what about if it will 20 points? As I know Google Maps recommends 23 points

enter image description here

xomena
  • 31,125
  • 6
  • 88
  • 117
Baraban
  • 3
  • 2

1 Answers1

0

You can now use the Google Maps URLs API launched by Google in May 2017.

https://developers.google.com/maps/documentation/urls/guide

Using this API you can construct navigation URL and specify waypoints in addition to origin and destination.

So the sample code might be something like

Uri gmmIntentUri = Uri.parse("https://www.google.com/maps/dir/?api=1&origin=Madrid,Spain&destination=Barcelona,Spain&waypoints=Zaragoza,Spain%7CHuesca,Spain&travelmode=driving&dir_action=navigate");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);    
mapIntent.setPackage("com.google.android.apps.maps"); 
startActivity(mapIntent);

I hope this helps!

xomena
  • 31,125
  • 6
  • 88
  • 117