Reputation: 4398
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
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
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