cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Bowser (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-2282) HTML5 Application Cache is not enabled
Date Fri, 25 Jan 2013 23:17:14 GMT

     [ https://issues.apache.org/jira/browse/CB-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Joe Bowser updated CB-2282:
---------------------------

    Description: 
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);
    
});

  was:

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);
    
});

     Issue Type: Improvement  (was: Bug)
    
> HTML5 Application Cache is not enabled
> --------------------------------------
>
>                 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
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> 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