Help Center

Local Navigation

Object: ApplicationCache

Availability

BlackBerry® Device Software version 6.0 or later

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

HTML 5

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.

HTML 5

6.0 or later

1

IDLE

The application cache is idle, that is, not in the process of beign updated.

HTML 5

6.0 or later

2

CHECKING

The application cache manifest is being retrieved and checked for updates.

HTML 5

6.0 or later

3

DOWNLOADING

The resources specified in the application cache manifest are being downloaded.

HTML 5

6.0 or later

4

UPDATEREADY

A new version of the application cache is available.

HTML 5

6.0 or later

5

OBSOLETE

The application cache is obsolete.

HTML 5

6.0 or later

ApplicationCache event handlers

Property name

Type

Description

Status

Availability

oncached

EventListener

Specifies the function to perform when caching of resources defined in the application cache manifest is completed.

writable

6.0 or later

onchecking

EventListener

Specifies the function to perform when retrieving the application cache manifest and checking for updates.

writable

6.0 or later

ondownloading

EventListener

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

EventListener

Specifies the function to perform when an error occurs during the caching of resources.

writable

6.0 or later

onnoupdate

EventListener

Specifies the function to perform when there is no update to download.

writable

6.0 or later

onobsolete

EventListener

Specifies the function to perform when the application cache becomes obsolete.

writable

6.0 or later

onprogress

EventListener

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

EventListener

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.

DOM 2 Events

6.0 or later

dispatchEvent()

Dispatches an Event object created by Document.createEvent().

DOM 2 Events

6.0 or later

removeEventListener()

Removes an event listener from an EventTarget.

DOM 2 Events

6.0 or later

swapCache()

Switches to the most recent version of the cache, if it exists.

HTML 5

6.0 or later

update()

Begins downloading the application cache resources.

HTML 5

6.0 or later

Next topic: Range API
Previous topic: Offline applications API

Was this information helpful? Send us your comments.