I'm writing a HTML5 application that I want to release on the iOS app store. Either using PhoneGap or wrapped in a UIWebView control.
I'm a bit confused about what options I have in terms of storing data for my application.
Are using localStorage, WebSQL or IndexedDB technologies appropriate for storing application data in this type of application? I will be storing JSON and XML data.
Keep in mind, if the user inadvertently deletes this data then they will have lost their work, which obviously I don't want to happen.
I understand that the only real way to alleviate this risk is to sync the data to the "cloud" or other online system - I can do that in a future release, but not right now. Initially I just want to store the data locally if that is a reasonable stable way to do things.
From what I understand, when clearing the cookies the browser will also clear any localStorage data. So that rules that out, as I can see users doing that by accident.
WebSQL looks pretty good - the user can't inadvertently delete it on iOS. They would actually have to go into the browser settings and delete the database manually.
But the downside of WebSQL is that it may not be supported in the future from what I've read.
With IndexedDB, I am not clear when that data gets cleared. Will it also removed when cookies are deleted, or does the "databases" option in the Safari settings control this?
Is IndexedDB the better solution, as it will have better support than WebSQL in the future?
Are there other solutions that are more appropriate that I am not aware of?