谷歌Android路线服务可用本机?有包装的框架?公交/骑自行车的方向可用? [英] Android Google Directions Service usable natively? with wrapper framework? Public transit/biking directions available?

查看:163
本文介绍了谷歌Android路线服务可用本机?有包装的框架?公交/骑自行车的方向可用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于Android和谷歌路线服务的几个问题:

Some Questions about Android and Google Directions Service:

  • 有没有在Android原生的方式使用路线服务从谷歌还是有什么漂亮的包装框架? 我想检索需要从A到B,也许显示表和/或地图路线的时间。

  • Is there a native way on Android to use the Directions Service from Google or are there any nice Wrapper Frameworks? I would like to retrieve the time needed to get from A to B and maybe show the route in a table and/or map.

据我所知方向只能检索走和行驶。有没有一种方法(也许不是来自谷歌),以获得这方面的信息也为公共交通还是自行车?

As far as I know directions can only be retrieved for "walking" and "driving". Is there a way (maybe not from google) to get this Information also for public transports or "biking" ?

THX了很多的帮助!

Thx a lot for your help!

推荐答案

我不知道到底,如果这是你想要什么,但你可以火​​起来像这样的意图:

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));

要获得骑车路线添加&放大器; dirflg = B的URL。对于公共交通增加了dirflg = R。

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

这将显示在谷歌地图应用程序的途径。如果你想获得这一个图形页面内你的应用程序,请参见这code在GitHub上。你可以攻入code增加自行车和公共交通的功能。

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.

这篇关于谷歌Android路线服务可用本机?有包装的框架?公交/骑自行车的方向可用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆