HTML5 ApplicationCache
The applicationCache object is your programmatic access to the browser's app cache.
Support for Application Cache on BlackBerry Smartphones starts with 6.0.0.418
Supported Platform(s)
- BlackBerry OS 6.0+ |
- BlackBerry PlayBook 1.0+ |
- BlackBerry 10 |
- Ripple Emulator |
API | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
---|---|---|---|---|---|---|---|
window.applicationCache | Y | Y | Y | Y | Y | Y | |
worker.applicationCache | Y | Y | Y | Y | Y | Y | |
swapCache | Y | Y | Y | Y | Y | Y | |
update | Y | Y | Y | Y | Y | Y | |
status | Y | Y | Y | Y | Y | Y | |
UNCACHED | Y | Y | Y | Y | Y | Y | |
IDLE | Y | Y | Y | Y | Y | Y | |
CHECKING | Y | Y | Y | Y | Y | Y | |
DOWNLOADING | Y | Y | Y | Y | Y | Y | |
UPDATEREADY | Y | Y | Y | Y | Y | Y | |
OBSOLETE | Y | Y | Y | Y | Y | Y | |
cached | Y | Y | Y | Y | Y | Y | |
checking | Y | Y | Y | Y | Y | Y | |
downloading | Y | Y | Y | Y | Y | Y | |
error | Y | Y | Y | Y | Y | Y | |
noupdate | Y | Y | Y | Y | Y | Y | |
obsolete | Y | Y | Y | Y | Y | Y | |
progress | Y | Y | Y | Y | Y | Y | |
updateready | Y | Y | Y | Y | Y | Y |
Configuration Document Settings
To use all of the API described for this object, you must ensure the following settings are in your configuration document: |
This API does not require a <feature> element to be declared in the configuration document of your BlackBerry WebWorks Application. |
Permission Elements (PlayBook and BlackBerry 10+) |
---|
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application. |
Constructors
Events
void | cached |
void | checking |
void | downloading |
void | error |
void | noupdate |
void | obsolete |
void | progress |
void | updateready |
Properties
Number | status |
Constants
Number | UNCACHED |
Number | IDLE |
Number | CHECKING |
Number | DOWNLOADING |
Number | UPDATEREADY |
Number | OBSOLETE |
Constructors
window.applicationCache
Returns the ApplicationCache object that applies to the active document of that Window.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Code Example:
|
worker.applicationCache
Returns the ApplicationCache object that applies to the current shared applicationCache.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Code Example:
|
Functions
void
swapCache
()
Switches to the most recent application cache, if there is a newer one.
This does not cause previously-loaded resources to be reloaded; for example,
images do not suddenly get reloaded and style sheets and scripts do not get reparsed or reevaluated.
The only change is that subsequent requests for cached resources will obtain the newer copies.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Throws | |
---|---|
INVALID_STATE_ERR | If the current app cache is the most recent |
Code Example:
|
void
update
()
Invokes the application cache download process.
Throws an INVALID_STATE_ERR exception if there is no application cache to update.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Code Example:
|
Events
void
cached
()
Sent when the resources listed in the manifest have been downloaded,
and the application is now cached.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Code Example:
|
void
checking
()
Sent when the cache update process begins.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Code Example:
|
void
downloading
()
Sent when the update process begins downloading resources in the manifest file.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Code Example:
|
void
error
()
Sent when an error occurs.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Code Example:
|
void
noupdate
()
Sent when the update process finishes but the manifest file does not change.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Code Example:
|
void
obsolete
()
Sent when the manifest was found to have become a 404 or 410 page,
so the application cache is being deleted.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Code Example:
|
void
progress
()
Sent when each resource in the manifest file begins to download.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Code Example:
|
void
updateready
()
Sent when there is an existing application cache, the update process finishes,
and there is a new application cache ready for use.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Code Example:
|
Properties
Number
status
The current state of the application cache that the ApplicationCache object's cache host is associated with, if any.
This must be the appropriate value from the following list:
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
Code Example:
|
Constants
static
Number
UNCACHED
= 0
The ApplicationCache object's cache host is not associated with an application cache at this time.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
static
Number
IDLE
= 1
The ApplicationCache object's cache host is associated with an application cache whose application cache group's update status is idle, and that application cache is the newest cache in its application cache group, and the application cache group is not marked as obsolete.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
static
Number
CHECKING
= 2
The ApplicationCache object's cache host is associated with an application cache whose application cache group's update status is checking.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
static
Number
DOWNLOADING
= 3
The ApplicationCache object's cache host is associated with an application cache whose application cache group's update status is downloading.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |
static
Number
UPDATEREADY
= 4
The ApplicationCache object's cache host is associated with an application cache whose application cache group's update status is idle, and whose application cache group is not marked as obsolete, but that application cache is not the newest cache in its group.
Supported Platforms | |
---|---|
- BlackBerry OS 6.0+ | |
- BlackBerry PlayBook 1.0+ | |
- BlackBerry 10 | |
- Ripple Emulator |