5

I'm about to embark on a project targeted at tablet devices - essentially a bunch of "surveys", that need to work offline.

Constraints:

  • Hopefully device agnostic
  • Hopefully work on a desktop too
  • Needs to store 10-25Mb worth of data

As a result there are several options... e.g.

A.) I can use a framework like PhoneGap so that I can deploy to multiple platforms and have the extended benefits of the wrapper.

B.) I can go entirely native, but then need to write duplicate code for multiple platforms and I don't have a desktop version

c.) I use HTML5 (offline and WebSQL/localStorage) (yes I'm aware of the WebSQL/IndexedDB debate, but for now "working on webkit based browsers" is sufficient)

I'm heavily leaning on option (C) as I'd really like to run this as a web based application - but I haven't dabbled much into offline support/WebSQL. I've read similar questions on StackOverflow that indicate a cap of 5Mb for localStorage, and my brief tests of attempting to create an 8 or 15Mb DB prompt (on iOS/Safari) the user to allow 10Mb or 50Mb respectively - which I think will be enough space.

Before I dive deep into this and commit to this HTML5 direction I want to know from others that have braved these waters already if there are any known gotchas that I should be aware of?

1 .) What size DB's have other developers successfully pushed to?

2 .) Can users accidentally delete a database, localStorage, or the cache and shoot themselves in the foot?

3 .) Are there any tablet devices that should "theoretically" be able to handle this that actually have issues?

Community
  • 1
  • 1
scunliffe
  • 62,582
  • 25
  • 126
  • 161

1 Answers1

2

You should not store critical data in the localStorage or web-based database on a mobile device. Just like a web browser, users can remove their caches at any time. Ideally, try to keep only things which can be re-downloaded on the fly, or are "okay" to lose.

  • Cookie replacement
  • Cached data
  • "Starred" (or saved) data

In my applications, I never need to store more than 5MB of data, but I know this is the soft limit on the iPhone. Users will be asked to increment the data when this occurs.

Josh Delsman
  • 3,022
  • 1
  • 18
  • 28
  • 1
    Thanks Josh - I understand your concerns but in my case the users will be downloading content, going out into the field and making modifications to return a few days later to sync back up. Yes the user could go and delete the work they just did but they would be unwise to do so. I think some basic documentation for the end users would cover the "hey, don't delete the database if you want your work to be saved" cases. I could click the delete key while highlighting the Program Files directory in Windows - but typically I don't. ;-) – scunliffe Aug 17 '11 at 11:59