mugetsu
mugetsu

Reputation: 4398

phonegap localstorage saves after power off?

Does data saved via localstorage in phonegap remains retained even after the app/phone is turn off and restarted? If not, should I be using sqlite instead?

Upvotes: 7

Views: 5369

Answers (2)

user1233033
user1233033

Reputation:

phonegap 1.4.1 on android 2.3 (api level 8) does not persist data either by localStorage or websql through a phone power off/on cycle. renders it useless. trying file api instead.

Upvotes: 2

Libby
Libby

Reputation: 866

Yes, but you are actually using HTML5 web storage (great write-up here) to store the persistent data, not phonegap.

I wrote a tutorial on using local storage (on PhoneGap / Android). If you're not interested in the full tutorial, search the page for "localStorage" and "JSON" (for parse() and stringify()) for examples of their use.

Upvotes: 10

Related Questions