Question

I'm doing a Wep App using the HTML5 Geolocation API. I'm using the typical W3C code given here http://dev.w3.org/geo/api/spec-source.html with the getCurrentPosition method.

On the Android browser it only works if GPS is enabled and gets the position. If it doesn't (indoors for example), the API returns the timeout error. Idem in a webview (with the correct permissions). It means that it does not use the other sources of geolocation.

On the contrary on Windows Mobile or with Opera on the Android device if the GPS can't reach the position it returns the Cell-ID source position (Relay Antenna based source).

How can I make it works with the Android browser ?

Thanks for your help.

Android version I'm using : 2.2.1.

Was it helpful?

Solution

Actually it was coming from the permissions. Even if it specified in the Application manifest you have to allow the location using Cell-ID on the mobile : go to the mobile Parameters/ Location and security then check "Use wireless networks" (it includes the ID Cell). Unfortunately by doing this you allow Google to collect your location data.

It's strange that it was working anyway on Opera browser.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top