Skip to content

Instantly share code, notes, and snippets.

@jaydeepw
Last active August 9, 2025 12:06
Show Gist options
  • Select an option

  • Save jaydeepw/3594828 to your computer and use it in GitHub Desktop.

Select an option

Save jaydeepw/3594828 to your computer and use it in GitHub Desktop.

Revisions

  1. jaydeepw renamed this gist Nov 1, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. jaydeepw created this gist Sep 2, 2012.
    15 changes: 15 additions & 0 deletions gistfile1.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    private void enableHTML5AppCache() {

    webView.getSettings().setDomStorageEnabled(true);

    // Set cache size to 8 mb by default. should be more than enough
    webView.getSettings().setAppCacheMaxSize(1024*1024*8);

    // This next one is crazy. It's the DEFAULT location for your app's cache
    // But it didn't work for me without this line
    webView.getSettings().setAppCachePath("/data/data/"+ getPackageName() +"/cache");
    webView.getSettings().setAllowFileAccess(true);
    webView.getSettings().setAppCacheEnabled(true);

    webView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
    }