How can I just delete the offline cache in Android software?

I am trying to delete files offline (defined in cache.manifest files) without deleting any WebSQL databases or local storage data.

I experimented with deleting cache files and used the related answers on stackoverflow and elsewhere to delete the WebView cache using answers from the following approaches:

Android Webview - completely clear the cache in stating that manually delete files in Context.getCacheDir();FWIW, I noticed the same result from the use of a simpler approach (which took an unacceptable response) WebView.clearCache(true);. This approach removes cached files that are not included in cache.manifest.

I also used the technique described in several other places where use is mentioned

deleteDatabase("webview.db");
deleteDatabase("webviewCache.db");

without affecting my files offline. I verifiably deleted webview.db, but strangely enough, I never saw the webviewCache.db file using Context.databaseList().

(Aside, I doubt deleting webview.db since I noticed a crash after deleting webview.db and trying to insert text in the input field the next time I open my application. It seems to be some defensive programming around this trick for some applications, at least least

android.database.sqlite.SQLiteException: no such table: formurl: , while compiling: SELECT _id FROM formurl WHERE (url == ?)
    at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
    at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64)
    at android.database.sqlite.SQLiteProgram.compileSql(SQLiteProgram.java:146)
    at android.database.sqlite.SQLiteProgram.compileAndbindAllArgs(SQLiteProgram.java:367)
    at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:130)
    at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:94)
    at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:46)
    at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:47)
    at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1539)
    at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1419)
    at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1375)
    at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1455)
    at android.webkit.WebViewDatabase.getFormData(WebViewDatabase.java:1150)
    at android.webkit.WebView$RequestFormData.run(WebView.java:4493)
    at java.lang.Thread.run(Thread.java:1020)

)

"clear cache" , . " " , , WebSQL . , " ", , , .

, , , -, . - JS/HTML/CSS WebSQL , Android WebView.

-, , .

+3

All Articles