Provides access to the device's storage options.

This API offers storage options based on two different W3C specifications:

  • The Web Storage API Specification allows you to access data via simple key/value pairs. See the section on localStorage for complete details on this interface.

  • The Web SQL Database Specification offers more full-featured database tables accessed via SQL queries. A summary of this interface appears immediately below.

Cordova provides access to both interfaces for the minority of devices that don't already support them. Otherwise the built-in implementations apply.




Accessing the Feature

As of version 3.0, access to Storage APIs is built into Cordova, and does not require using the CLI to add plugins as described in The Command-line Interface.

If you are using the older set of Cordova tools that precede the CLI, the following platform-specific configuration settings are still required:

  • Android (in app/res/xml/config.xml)

    <feature name="Storage">
        <param name="android-package" value="org.apache.cordova.Storage" />
  • BlackBerry WebWorks (in www/config.xml)

    <feature id="blackberry.widgetcache" required="true" version="" />

Some platforms may support this feature without requiring any special configuration. See Platform Support for an overview.