ullstrm
ullstrm

Reputation: 10170

Launch maps app with directions and checkpoints

What I want to do is simple. I want to launch an intent like this.

        String url = "https://maps.google.com/maps?saddr=47.295601,0.010586&daddr=47.295601,1.010586+to:47.295601,2.010586+to:47.295601,3.01058";
        Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
                Uri.parse(url));

The url is this: https://maps.google.com/maps?saddr=47.295601,0.010586&daddr=47.295601,1.010586+to:47.295601,2.010586+to:47.295601,3.01058

The intent launches fine, and I get to choose between "Maps" and "Browser"-apps.

When I choose to open this intent with the "Browser", I can see the route with it's checkpoints without problems.

However, if i choose to open it with the Maps-app. It will say "No results for 47.295,1.010 to:47.295,2.010..... etc"

How to format the url to be able to open the Maps-app with navigation and checkpoints?

(Even if you open this link in your phone from the browser, it will ask you if you want to open the Maps-app. The same problem will occur if you do.)

thank you!

EDIT: I clarify: I want to know how to get directions from point A to Y, via point B,C,D,E...etc.

How to get directions from point A to B I; know how to do.

Upvotes: 2

Views: 1243

Answers (1)

Ganesh Bhat
Ganesh Bhat

Reputation: 243

The following thing works for me. This is the google designated way for launching the google apps.

Intent intent = new Intent(Intent.ACTION_VIEW, 
       Uri.parse("geo:47.295601,1.010586?q=my+street+address&z=20"));
startActivity(intent);

The link for the same is below

http://developer.android.com/guide/appendix/g-app-intents.html

Following post is also providing lots of information on the same

Launching Google Maps Directions via an intent on Android

Launching Google Maps and Navigator from Android App

Hope this helps

Upvotes: 1

Related Questions