I need to show the driving direction using external google map application i found this link http://developer.android.com/guide/appendix/g-app-intents.html ,but the below opens the Maps application to the given location
Uri uri = Uri.parse("geo:13.070984,80.253639");
Intent in = new Intent(Intent.ACTION_VIEW, uri);
startActivity(in);
I need to know is there is any way to pass two geo location to get driving direction.
I've implemented this by firing an intent that uses a Google Maps URL - the Maps application picks it up, and it works. I think it is not officially recommended, but for me is working well.
The above works for location NAMES, you may need to tweak it to use lat/long. Here's an example Google Maps directions URL between two lat/long points that will be useful: http://maps.google.co.uk/maps?f=d&source=s_d&saddr=A685&daddr=M40&hl=en&geocode=FazjPwMdRKPc_w%3BFeS8GgMdNMfr_w&mra=me&mrsp=1,0&sz=5&sll=53.800651,-4.064941&sspn=22.244994,67.631836&ie=UTF8&t=h&z=5
You can get routing between two locations with the following URL.
https://maps.google.com/maps?saddr=kedah&daddr=johor
saddr is the start, and daddr is the destination.
Example code:
yes its very easy to show the direction if you have the latitude and longitude of both source and destination. Just see the following code:
Where
latitude_source=Latitude
of your sourcelongitude_source=Longitude
of your sourcelatitude_dest=Latitude
of your destinationlongitude_dest=Longitude
of your destinationJust replace these value with your actual data. .Use the above code on some particular event.
Hope this will help you.