html5 Android 应用上的 Google 导航 [英] Google navigation on a html5 Android app
问题描述
我只是想知道是否有人可以解释为什么会发生在我身上.
I just wanted to know if someone can explain why is this happening to me.
我正在使用 phonegap 和 jquerymobile 开发一个移动应用程序,该应用程序的功能之一是使用导航工具引导用户.
I am developing a mobile app using phonegap and jquerymobile and one of the features of the app is to guide the user using a navigation tool.
对于 iOS,我们选择 Waze.添加它真的很容易:
For iOS we have choose Waze. It is really easy to add it:
<a href=" waze://q=Adress">
它有效!如果我们使用 safari 运行应用程序,或者即使我们使用 phonegap 构建本机应用程序,它也可以工作.
and it works! It works if we run the app using safari or even if we build a native app using phonegap.
使用 Android 时出现问题.对于 android,我们使用的是 Google Navigation.我们使用的代码是:
The problem comes when using Android. For android we are using Google Navigation. The code we are using is:
<a href="google.navigation:q=Adress">
它工作正常,但只有当我们使用 phonegap 使用我们的 htlm 代码构建本机应用程序时,但如果我们在 Android Web 浏览器上运行该应用程序,它就无法工作.
It is working ok, but only if we build a native app with our htlm code using phonegap but it is not working if we run the app on Android Web Browser.
我们不希望用户安装应用程序来使用此功能...问题是:为什么?为什么 html 代码在本机应用程序的 webview 中运行正常,但在 Android 浏览器上却无法运行?
We dont want the user to install the app to use this feature... The question is: Why? Why the html code is working ok inside a webview on a native app but it is not working on Android Browser?
推荐答案
我刚刚遇到了同样的问题并使用了地理 URI,它正在工作:
I just had the same issue and used the geo URI and it is working:
<a href="geo:37.786971,-122.399677;u=35">Wikimedia Headquarters</a>
有关更详细的说明,请参阅此链接:http://en.wikipedia.org/wiki/Geo_URI#Example
for a more detailed explanation see this link: http://en.wikipedia.org/wiki/Geo_URI#Example
上面的 href 将打开导航应用程序,例如 Android 上的 waze(刚刚在带有 Waze 的 Galaxy S4 上对其进行了测试,它正在工作 - 它还打开了 Google Maps/Navigation 应用程序,它现在是一个组合应用程序).
The href above will open navigation apps, such as waze on Android (just tested it on the Galaxy S4 with Waze and it is working - it also opens up the Google Maps/Navigation app, which is now a combined app).
希望这会有所帮助!:)
Hope this helps! :)
这篇关于html5 Android 应用上的 Google 导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!