Cordova – PhoneGap: storage

Local Storage

The local storage capabilities of PhoneGap allow an application to persist data as key/value pairs stored with the application. The local storage option is designed to support data that needs to be available between sessions—maintained when the application closes and available when the application launches again.

To write a value to local storage, an application would use the following code: window.localStorage.setItem(“key_name”, value); To retrieve a value from local storage, an application would use the following code:
value = window.localStorage.getItem(“key_name”);


Leave a Reply