Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0E48AE706 for ; Sat, 26 Jan 2013 14:59:14 +0000 (UTC) Received: (qmail 13602 invoked by uid 500); 26 Jan 2013 14:59:13 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 13531 invoked by uid 500); 26 Jan 2013 14:59:13 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 13510 invoked by uid 500); 26 Jan 2013 14:59:12 -0000 Delivered-To: apmail-incubator-callback-dev@incubator.apache.org Received: (qmail 13506 invoked by uid 99); 26 Jan 2013 14:59:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Jan 2013 14:59:12 +0000 Date: Sat, 26 Jan 2013 14:59:12 +0000 (UTC) From: "Rudolf Kuczi (JIRA)" To: callback-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-2282) Enable AppCache on CordovaWebView and InAppBrowser MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13563510#comment-13563510 ] Rudolf Kuczi commented on CB-2282: ---------------------------------- I'm storing AppCache Database at the following location: /data/data/com.adcodedesign.appCache/cache (My Android app's package name is: com.adcodedesign.appCache) There's an error in the log: 01-26 15:52:10.610: I/SqliteDatabaseCpp(16516): sqlite returned: error code = 14, msg = cannot open file at line 29848 of [c7c6050ef0], db=/data/data/com.adcodedesign.appCache/databases/webview.db 01-26 15:52:10.610: I/SqliteDatabaseCpp(16516): sqlite returned: error code = 14, msg = os_unix.c:29848: (2) open(/CachedGeoposition.db) - , db=/data/data/com.adcodedesign.appCache/databases/webview.db But I've ignored it because 1) HTML5 App Cache is functioning regardless of the I/SqliteDatabaseCpp error. 2) When I build the official Hello World sample from GitHub using official Adobe PhoneGap build (target: PhoneGap 2.2.0) the same I/SqliteDatabaseCpp error is also visible in the log. So I'll report it as another issue. I'm using the following code in DroidGap.java init() to initialize: this.appView.getSettings().setAppCacheMaxSize(5 * 1048576); String pathToCacheDir = this.getApplicationContext().getCacheDir().getAbsolutePath(); this.appView.getSettings().setAppCachePath(pathToCacheDir); this.appView.getSettings().setAppCacheEnabled(true); LOG.d(TAG, "DroidGap.init() turned on AppCache at [" + pathToCacheDir + "]"); > Enable AppCache on CordovaWebView and InAppBrowser > -------------------------------------------------- > > Key: CB-2282 > URL: https://issues.apache.org/jira/browse/CB-2282 > Project: Apache Cordova > Issue Type: Improvement > Components: Android > Affects Versions: 2.2.0, 2.3.0 > Environment: Tested on LG Optimus 2x (LG-P990) with Android 4.0.4 physical device and on Android 4.0.3 x86 virtual device. > Tested PhoneGap versions: 2.2.0, 2.3.0 > Reporter: Rudolf Kuczi > Assignee: Joe Bowser > Fix For: 2.5.0 > > > By default HTML5 Application Cache is disabled when instantiating a WebView on Android: http://developer.android.com/reference/android/webkit/WebSettings.html#setAppCacheEnabled(boolean) > PhoneGap app container also instantiate WebView with AppCache disabled. > I've modified DroidGap.java to call .setAppCacheEnabled(true) and now the AppCache works within PhoneGap and the following javascript receives AppCache event. > Event log sample: > 01-22 11:37:43.947: D/CordovaLog(6111): checking > 01-22 11:37:43.947: D/CordovaLog(6111): noupdate > How to reproduce: > With cache disabled no events fired by the following javascript code: > function logEvent(event) { > console.log(event.type); > } > window.applicationCache.addEventListener('checking', logEvent, false); > window.applicationCache.addEventListener('noupdate', logEvent, false); > window.applicationCache.addEventListener('downloading', logEvent, false); > window.applicationCache.addEventListener('progress', logEvent, false); > window.applicationCache.addEventListener('cached', logEvent, false); > window.applicationCache.addEventListener('updateready', logEvent, false); > window.applicationCache.addEventListener('obsolete', logEvent, false); > window.applicationCache.addEventListener('error', logEvent, false); > > }); -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira