4


I am new to Android google maps APIs. I am learning it from this TUT : http://mobiforge.com/developing/story/using-google-maps-android but there isn't any mention of getting the direction between 2 points. Is there any APIs can do this task in http://code.google.com/android/add-ons/google-apis/reference/index.html ?

Thank in advance !

IT-Fan
  • 373
  • 3
  • 5
  • 10

2 Answers2

3

Google maps API does not provide any routing capabilities. You can use an intent to fire the google navigator (assuming it's on your device) or the the google maps version (as mentioned by Hwa Rang)

There are some tutorials to do this outside of the API, but be advised the google prohibits implementing turn by turn navigation, apparently simple routing is ok though.

How to add routing to google maps

Community
  • 1
  • 1
Idistic
  • 6,281
  • 2
  • 28
  • 38
2

There is an intent to the Google Maps app you can use.

Intent i = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?saddr=" + saddr + "&daddr=" + daddr));
nahwarang
  • 654
  • 5
  • 9
  • This is the easiest way but not what I am looking for. With this method it will launch a browser or a default map in Android. What I need is integrating the function into my application so I prefer what Idistic referred. Thank anyway :) – IT-Fan Jul 17 '11 at 22:32