如何在webView中更改地理位置

时间:2018-11-26 19:56:26

标签: android webview geolocation

例如,使用WebView应用程序的人住在加拿大。我希望此人的职位更改为阿拉伯联合酋长国。我做了很多研究,但没有做到。我怎样才能做到这一点? , 我想要所有国家的阿拉伯联合酋长国。

    webView.getSettings().setBuiltInZoomControls(true);
    webView.getSettings().setAllowContentAccess(true);
    webSettings.setAllowContentAccess(false);
    webSettings.setAllowFileAccessFromFileURLs(true);
    webSettings.setDomStorageEnabled(true);
    webSettings.setRenderPriority(WebSettings.RenderPriority.HIGH);
    webSettings.getSaveFormData();
    webSettings.setDisplayZoomControls(false);
    webSettings.setUseWideViewPort(true);
    webSettings.setAppCacheEnabled(false);
    webSettings.setJavaScriptEnabled(true);
    webSettings.setSavePassword(true);
    webSettings.setSupportMultipleWindows(true);
    webSettings.setDatabaseEnabled(true);
    webSettings.getJavaScriptEnabled();
    webSettings.setAllowFileAccess(true);
    webSettings.setGeolocationEnabled(true);
    webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
    webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
    webSettings.setUserAgentString("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36");
    String url = "https://www.google.co.uk";
    webView.loadUrl(url);

0 个答案:

没有答案