Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically launch map application in android to show direction?

My client asked me to show directions between two location. Therefore he wants that our application should launch map application of android and show direction between two location. I could not find the solution for this problem.

Therefore can anybody tell me how to programmatically launch map application from our current application and show directions between two location in Android.

How do I achieve this?

like image 418
Sanchit Paurush Avatar asked Dec 12 '22 01:12

Sanchit Paurush


1 Answers

Try this:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345"));
startActivity(intent);
like image 76
Awais Tariq Avatar answered Dec 25 '22 23:12

Awais Tariq