I have an Android app that simply houses a website. I would like the app to cache the pages of the website for offline use.
I\'m doing a simple test to see if the cache
This is not the exact answer to your question, as you are asking about webview cache. But, it can achieve the same result.
// saving page from web to file
File file = new File(this.getExternalFilesDir(null), "fileName.html");
FileUtils.copyURLToFile(new URL("http://www.bmimobile.co.uk/why-bmi.php"), file);
// loading saved file in webview
webview.loadUrl("file://" + file.getPath());
This is a more flexible approach, as you have control over loading, saving, and much more.