Google navigation on a html5 Android app

2019-04-02 01:21发布

问题:

I just wanted to know if someone can explain why is this happening to me.

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.

For iOS we have choose Waze. It is really easy to add it:

<a href=" waze://q=Adress">

and it works! It works if we run the app using safari or even if we build a native app using phonegap.

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">

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.

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?

回答1:

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>

for a more detailed explanation see this link: http://en.wikipedia.org/wiki/Geo_URI#Example

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! :)