The PhoneGap application in Android didn't use the cached file. But the HTML5 Application Cache is enabled and trigger event correctly.
I had a website use HTML5 Application Cache:
index file:
<!DOCTYPE html>
<html manifest="cache.appcache">
<head>
<link rel="stylesheet" type="text/css" href="site.css">
</head>
<body>
<div>
Hello World
</div>
</body>
</html>
css file:
div{
background-color: red;
}
appcache file:
CACHE MANIFEST
#v1
CACHE:
site.css
It works well in Chrome, iOS Web Broswer, PhoneGap in iOS, Android 2.1 Web Broswer. But it doesn't work in PhoneGap in Android!
I created the Android PhoneGap Application with command line,and just modify the startup url to my website. The Application will trigger the application cache event correctly:
// Fired after the first cache of the manifest.
appCache.addEventListener('cached', handleCacheEvent, false);
// Checking for an update. Always the first event fired in the sequence.
appCache.addEventListener('checking', handleCacheEvent, false);
// An update was found. The browser is fetching resources.
appCache.addEventListener('downloading', handleCacheEvent, false);
I didn't modify the cache.appcache
file! And the event shows that the cache didn't modify.
But it doesn't use the application cache.
What's wrong with it?