Is It Possible To Access The Webview Cache?
I have a WebView in which I can access to web pages. Is it possible, when I am offline to have access for example to the images that have been previously downloaded? And if it is p
Solution 1:
Yes, you can, at least for Android 2.3 and lower.
If you want to see the entire cache folder, it is situated here:
<android cache dir>/<your app package>/cache/webviewCache/
If you already know the URL of the cached image, you can get the actual file so:
Stringuri="http://the url of the image that you need";
StringhashCode= String.format("%08x", uri.hashCode());
Filefile=newFile(newFile(getCacheDir(), "webviewCache"), hashCode);
// if the call file.exist() returns true, then the file presents in the cache
Solution 2:
If someone else faces this problem, I had a similar issue and I solve it managing(saving and retrieving) my app cache manually. Here it is my related post.
Post a Comment for "Is It Possible To Access The Webview Cache?"