开发者

Mobile Web: Request user's location when GPS is turned off

开发者 https://www.devze.com 2023-02-07 10:01 出处:网络
I\'m building a mobile web app that incorporates GeoLocation.On the Android browser (OS 2.0+) if the user has GPS turned off, a request from my web app to get their location does NOT show up.If their

I'm building a mobile web app that incorporates GeoLocation. On the Android browser (OS 2.0+) if the user has GPS turned off, a request from my web app to get their location does NOT show up. If their GPS is turned on, then a location permission request does show up.

I know that requesting a user's l开发者_JS百科ocation from the browser when GPS is off is possible as Gowalla's mobile web app is able to trigger the request. I looked through their sprocket.js file and it looks pretty straight forward. Any ideas what the secret is here?


They just try different frameworks (Google Gears, Blackberry, and so on) and if one works they use it. If GPS is deactivated you can either use the the last location (if it's not too old) or in the worst case you can try something with the IP and a geolocation-DB, although the results won't be accurate at all.


You could start a location manager in your java before you call the web view. As long as you have the have the fine location access in your manifest, you might be able to turn on geolocation.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号