Skip to content Skip to sidebar Skip to footer

How To Pass A List Of Coordinates To The Default Google Map Application?

From my app i am opening the default google map app. Here is how i am doing it. String uri = String.format(Locale.ENGLISH, 'geo:0,0?q=%f,%f(%s)', locationList.get(1

Solution 1:

Here try this:

Stringdestination= locationList.get(1).getLatitude()+","
                    +locationList.get(1).getLongitude();
            UrigmmIntentUri= Uri.parse("google.navigation:q="+destination+"&mode=d");
            Log.e(TAG,"Intent uri : "+gmmIntentUri.toString());
            IntentmapIntent=newIntent(Intent.ACTION_VIEW, gmmIntentUri);
            mapIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            mapIntent.setPackage("com.google.android.apps.maps");
            this.startActivity(mapIntent);

this will open map in navigation mode from your current location to the specified destination.

you can have a look at the below link to specify way points between your source and destination: https://developers.google.com/maps/documentation/urls/android-intentshttps://developers.google.com/maps/documentation/urls/guide

Let me know if you have any doubts.

Post a Comment for "How To Pass A List Of Coordinates To The Default Google Map Application?"