Getting location via a web application being run in a WebView

Deadly 提交于 2019-12-11 10:10:01

问题


m.google.com somehow requests the current location when loaded in Android's browser.

I want to do the same thing from a web page being loaded into a WebView in my own application. Is the only way to go about this with WebView.addJavascriptInterface(), or is there already a javascript interface available for webapps to use?


回答1:


It's done via HTML5.

Lookup here the Javascript: http://dev.w3.org/geo/api/spec-source.html



来源:https://stackoverflow.com/questions/2511195/getting-location-via-a-web-application-being-run-in-a-webview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!