3

Given an array of urls, how can I delete appcached data from an embedded webview inside an app? Note: I don't want to clear all app-cache data, just the data which was stored for the given urls, similar to the solution for iOS's UIWebview presented here.

It seems that the Application Cache is stored very differently in Android compared to iOS, see the following structure of a simple Cordova app after I stored some AppCache in it: enter image description here

I saw that the file "app_webview/Application Cache/Index" is actually an SQLite db file, and it contains relevant entries such as each cached file name, and to which website manifest each file belongs, but this SQLite database (unlike in iOS) does not store the actual file contents in BLOB entries, the actual files have these short hashed names and are stored under "app_webview/Application Cache/Cache/" with names like "4cb013792b196a35_O" (see screenshot) and I don't know to which entry in the SQLite db each file belongs, I see no relationship between these files and the SQLite entries.

I need a solution that works for a Crosswalk WebView too.

I've seen these "suspiciously" related PackageManager methods:
void clearApplicationUserData(String packageName, IPackageDataObserver observer);
void deleteApplicationCacheFiles(String packageName, IPackageDataObserver observer);
But I don't need to clear the cache for any other apps (just my own package), and I don't see how it can be tailored for my specific requirement.

Thanks.

0