Android Google Directions Service usable natively? with wrapper framework? Public transit/biking directions available?

前端 未结 1 1261
-上瘾入骨i
-上瘾入骨i 2020-12-08 22:13

Some questions about Android and Google Directions Service:

  • Is there a native way on Android to use the Directions Service from Google or are there any nice

相关标签:
1条回答
  • 2020-12-08 22:52

    I don't know exactly if this is what you want, but you could fire up an intent like this:

    String url = "http://maps.google.com/maps?saddr=some+address&daddr=another+Address"
    Intent intent = new Intent(android.content.Intent.ACTION_VIEW,  Uri.parse(url));
    

    To get biking directions add "&dirflg=b" to the url. For public transport add "dirflg=r".

    This will display the route in the google Maps app. If you want to get this in your app inside a mapview, please see this code at github. You could hack into the code to add biking and public transport functionality.

    Hope this helps somehow.

    0 讨论(0)
提交回复
热议问题