문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top