title: Geolocation not working on Android emulator
body: <p>When using Android Studio's Android emulator, Geolocation does not work. I tried every solution posted here on SO, but nothing seems to work. The code is just fine, since it works flawlessy on my actual device. This is the HTML-page I am using:</p>
  
  <pre><code> &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;script&gt;
  var x = document.getElementById("demo");
  
  function getLocation() {
      if (navigator.geolocation) {
          navigator.geolocation.getCurrentPosition(showPosition, showError, { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true });
      } else {
          x.innerHTML = "Geolocation is not supported by this browser.";
      }
  }
  
  function showPosition(position) {
      var latlon = position.coords.latitude + "," + position.coords.longitude;
      document.getElementById("locationHolder").innerHTML = latlon;
  }
  
  function showError(error) {
      switch(error.code) {
          case error.PERMISSION_DENIED:
              console.log("User denied the request for Geolocation.");
              break;
          case error.POSITION_UNAVAILABLE:
              console.log("Location information is unavailable");
              break;
          case error.TIMEOUT:
             console.log("The request to get user location timed out.");
              break;
          case error.UNKNOWN_ERROR:
              console.log("An unknown error occurred.");
              break;
      }
  }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;p id="demo"&gt;Click the button to get your position.&lt;/p&gt;
  
  &lt;div id="locationHolder"&gt;No location&lt;/div&gt;
  &lt;button onclick="getLocation()"&gt;Get position&lt;/button&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is the code of the webview:</p>
  
  <pre><code>public void openWebView(){
          WebView myWebView = (WebView) findViewById(R.id.webview);
          myWebView.addJavascriptInterface(new WebAppInterface(this), "Android");
          WebSettings webSettings = myWebView.getSettings();
          CookieManager.getInstance().setAcceptCookie(true);
          webSettings.setJavaScriptEnabled(true);
          webSettings.setAllowFileAccessFromFileURLs(true); 
          webSettings.setAllowUniversalAccessFromFileURLs(true);
          webSettings.setAllowFileAccess(true);
          webSettings.setAllowContentAccess(true);
          webSettings.setDomStorageEnabled(true);
          webSettings.setGeolocationEnabled(true);
          webSettings.setLoadWithOverviewMode(true);
          myWebView.setWebChromeClient(new WebChromeClient() {
              public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
                  callback.invoke(origin, true, false);
              }
          });
          myWebView.loadUrl("file:///android_asset/www/test.html");
  
          myWebView.setWebViewClient(new WebViewClient() {
              @Override
              public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
                  view.loadUrl(request.toString());
                  return true;
              }
  
  
          });
  
  
  
      }
  </code></pre>
  
  <p>And this is the output of the log:</p>
  
  <pre><code>05-20 08:09:23.442 28860-29006/com.app E/SQLiteLog: (14) cannot open file at line 30184 of [00bb9c9ce4]
  05-20 08:09:23.442 28860-28881/com.app E/SQLiteLog: (14) cannot open file at line 30184 of [00bb9c9ce4]
  05-20 08:09:23.442 28860-28881/com.app E/SQLiteLog: (14) os_unix.c:30184: (2) open(/GeolocationPermissions.db) - 
  05-20 08:09:23.442 28860-29006/com.app E/SQLiteLog: (14) os_unix.c:30184: (2) open(/CachedGeoposition.db) - 
  05-20 08:09:23.452 28860-28860/com.app I/Web Console: Location information is unavailable at file:///android_asset/www/test.html:26
  </code></pre>
  
  <p>This problem occurs with Nexus 4 API 18, but also with other emulators I've tried. I've chosen for these emulators for the Google API.</p>