cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rudolf Kuczi (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-2282) Enable AppCache on CordovaWebView and InAppBrowser
Date Sat, 26 Jan 2013 14:59:12 GMT

    [ 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

Mime
View raw message