Offline applications API
Object: ApplicationCache
The ApplicationCache object provides programmatic access to an associated manifest file. The manifest file defines the web resources that the browser must cache so that the web content can function while the BlackBerry device has no network connection. The ApplicationCache object lets you check the status of the manifest to determine whether updated resources are available and need to be downloaded, or whether the latest resources are already cached on the device.
ApplicationCache properties
|
Property name |
Type |
Description |
Status |
Support level |
Availability |
|---|---|---|---|---|---|
|
status |
unsigned short |
Returns the current state of the application cache, represented using an ApplicationCache constant. |
read only |
6.0 or later |
ApplicationCache constants
|
Constant |
Status value |
Description |
Support level |
Availability |
|---|---|---|---|---|
|
0 |
UNCACHED |
The object is not currently associated with an application cache. |
Offline Applications |
6.0 or later |
|
1 |
IDLE |
The application cache is idle, that is, not in the process of beign updated. |
Offline Applications |
6.0 or later |
|
2 |
CHECKING |
The application cache manifest is being retrieved and checked for updates. |
Offline Applications |
6.0 or later |
|
3 |
DOWNLOADING |
The resources specified in the application cache manifest are being downloaded. |
Offline Applications |
6.0 or later |
|
4 |
UPDATEREADY |
A new version of the application cache is available. |
Offline Applications |
6.0 or later |
|
5 |
OBSOLETE |
The application cache is obsolete. |
Offline Applications |
6.0 or later |
ApplicationCache event handlers
|
Property name |
Type |
Description |
Status |
Support level |
Availability |
|---|---|---|---|---|---|
|
oncached |
Specifies the function to perform when caching of resources defined in the application cache manifest is completed. |
writable |
6.0 or later |
||
|
onchecking |
Specifies the function to perform when retrieving the application cache manifest and checking for updates. |
writable |
6.0 or later |
||
|
ondownloading |
Specifies the function to perform when the resources defined in the application cache manifest are being downloaded to the cache. |
writable |
6.0 or later |
||
|
onerror |
Specifies the function to perform when an error occurs during the caching of resources. |
writable |
6.0 or later |
||
|
onnoupdate |
Specifies the function to perform when there is no update to download. |
writable |
6.0 or later |
||
|
onobsolete |
Specifies the function to perform when the application cache becomes obsolete. |
writable |
6.0 or later |
||
|
onprogress |
Specifies the function to perform periodically while the resources defined in the application cache manifest are being downloaded to the cache. |
writable |
6.0 or later |
||
|
onupdateready |
Specifies the function to perform when new resources are available. |
writable |
6.0 or later |
ApplicationCache methods
|
Method name |
Description |
Support level |
Availability |
|---|---|---|---|
|
addEventListener() |
Adds an EventListener object to a set of event listeners for the application cache. |
6.0 or later |
|
|
dispatchEvent() |
Dispatches an Event object created by Document.createEvent(). |
6.0 or later |
|
|
removeEventListener() |
Removes an event listener from an EventTarget. |
6.0 or later |
|
|
swapCache() |
Switches to the most recent version of the cache, if it exists. |
6.0 or later |
|
|
update() |
Begins downloading the application cache resources. |
6.0 or later |