Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid webview geoposition database failed to open
    text
    copied!<p>I have website using javascript geolocation api and want it to open in a webview. I set up these permissions in the manifest file: </p> <pre><code>&lt;uses-permission android:name="android.permission.ACCESS_GPS" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt; </code></pre> <p>In my activity, I also set webview settings:</p> <pre><code>webview.getSettings().setDatabaseEnabled(true); webview.getSettings().setDomStorageEnabled(true); webview.getSettings().setGeolocationDatabasePath("/data/data/com.my.app/databases"); webview.getSettings().setGeolocationEnabled(true); </code></pre> <p>And I also handled javascript geolocation dialog:</p> <pre><code>webview.setWebChromeClient(new WebChromeClient(){ @Override public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) { callback.invoke(origin, true, false); } }); </code></pre> <p>Geolocation itself is working, but I am not able to cache geoposition into the database. It should be doing it by itself into CachedGeoposition.db, but when I start the webview, i get this strange SQLite error:</p> <pre><code>E/SQLiteLog(22653): (14) cannot open file at line 30174 of [00bb9c9ce4] E/SQLiteLog(22653): (14) os_unix.c:30174: (2) open(/CachedGeoposition.db) - D/WebKit (22653): ERROR: D/WebKit (22653): SQLite database failed to load from /CachedGeoposition.db D/WebKit (22653): Cause - unable to open database file D/WebKit (22653): D/WebKit (22653): external/webkit/Source/WebCore/platform/sql/SQLiteDatabase.cp p(71) : bool WebCore::SQLiteDatabase::open(const WTF::String&amp;, bool) </code></pre> <p>When I check existence of CachedGeoposition.db file in File Explorer, it is always there, and permissions of the db are set to -rw-------.</p> <p>Did I miss something in settings what could cause database not to open correctly? I'm new to Android and trying to find solution for 2 days now. Any help would be greatly appreciated. Thank you.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload