Friday, August 6, 2010

show Driving Directions in a ListView in Android

AIM :  To show Driving Directions in a ListView in Android .
Solution:  
Generally,to see driving directions in a browser we use query as follows:
"http://maps.google.com/maps?&saddr=15.653293,78.809369&daddr=15.612456,78.706055"  
We use the same url in mobile also .
the code snip is:


Uri uri =Uri.parse("http://maps.google.com/maps?&saddr=15.653293,78.809369&daddr=15.612456,78.706055");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);



This will open intent chooser to view like open this either in Browser or Google Map.If you select  Google Map it will open the Map and fetch the driving directions in a listView.





2 comments:

  1. I'm amazed, I have to admit. Seldom do I encounter a blog that's equally educative and interesting, and without a doubt, you have hit the nail on
    the head. The problem is an issue that too few men and women are speaking intelligently about.
    I'm very happy I found this in my hunt for something concerning this.

    My page: bmi calculator women
    my webpage > bmi calculator women

    ReplyDelete
  2. Attractive sесtion of content. I јust stumbled uρon your sіte and in accessіon capital tο assегt thаt I get actually enjoyed acсοunt уοur blog posts.
    Anyωаy I'll be ѕubscribing to youг
    augment and even І achіevement you access consіstently fast.



    Alsο visіt my blog megapolis cheat

    ReplyDelete

Android Developers Blog

Ram's shared items