在iPhone上,一个maps.google.com网址拦截和本地谷歌地图应用程序加载。我想这样做在Android上是相同的,但谷歌地图正在加载浏览器。
On the iPhone, a maps.google.com URL is intercepted and loaded by the native google maps application. I would like do the same on Android, but Google Maps is being loaded in the browser.
所以,在一个网页,是有可能有这个网址http://maps.google.com/maps?saddr=brighton&daddr=timbuktu在Android谷歌地图应用程序中打开?
So, in a web page, is it possible to have this url http://maps.google.com/maps?saddr=brighton&daddr=timbuktu open in the Android Google Map application ?
我从this的问题,你可以从另一个应用程序通过一个意图去做。您可以从浏览器触发这些意图的?
I see from this question that you can do it from another app via an Intent. Can you trigger these Intent's from the browser ?
修改 - 在进一步的测试中,我发现,系统将提示用户打开了标准的HTML链接到maps.google.maps在浏览器或地图应用程序的链接:
Edit - On further testing, I've found that the user will be prompted to open the link in browser or map app for standard html links to maps.google.maps :
<a href="http://maps.google.com/maps?saddr=brighton&daddr=timbuktu">show route</a>
我,因为我使用JavaScript来设置通过位置API回调window.location.href遇到的问题(这样我就可以获取用户的位置,然后打开地图)。我已经开了一个 bug报告这一点。
打字GEO:?0,0 Q =谷歌在地址栏中打开地图活动和搜索谷歌附近
Typing geo:0,0?q=google into the address bar opens the maps activity and searches for google nearby.
我想这将工作从一个页面的链接,但还没有检查。
I assume this will work from a link in a page, but haven't checked.
在这里访问的意图的完整列表: http://developer.android.com/guide/appendix/g-app-intents.html
a full list of accessible intents here: http://developer.android.com/guide/appendix/g-app-intents.html