You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2013/02/18 20:42:33 UTC

android commit: CB-2282: Turning on AppCache

Updated Branches:
  refs/heads/master 13ef58a5b -> 892f96e30


CB-2282: Turning on AppCache


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/892f96e3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/892f96e3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/892f96e3

Branch: refs/heads/master
Commit: 892f96e30590ba921cbc3930d4de53e15dbf56ff
Parents: 13ef58a
Author: Joe Bowser <bo...@apache.org>
Authored: Mon Feb 18 11:37:28 2013 -0800
Committer: Joe Bowser <bo...@apache.org>
Committed: Mon Feb 18 11:37:28 2013 -0800

----------------------------------------------------------------------
 .../src/org/apache/cordova/CordovaWebView.java     |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/892f96e3/framework/src/org/apache/cordova/CordovaWebView.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java
index 06651b1..7d653c3 100755
--- a/framework/src/org/apache/cordova/CordovaWebView.java
+++ b/framework/src/org/apache/cordova/CordovaWebView.java
@@ -270,6 +270,13 @@ public class CordovaWebView extends WebView {
         // Enable built-in geolocation
         settings.setGeolocationEnabled(true);
         
+        // Enable AppCache
+        // Fix for CB-2282
+        settings.setAppCacheMaxSize(5 * 1048576);
+        String pathToCache = this.cordova.getActivity().getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
+        settings.setAppCachePath(pathToCache);
+        settings.setAppCacheEnabled(true);
+        
         // Fix for CB-1405
         // Google issue 4641
         this.updateUserAgentString();