0

I am working on an HTML5 application. This app must store data (lots of JSON & Base64 pictures) until the user synchronises it with our server. I must keep data stored on the device for a month after a sync.

I will use Phonegap for building the app. I know there is a limit of 5MB, so I'll certainly have to store my data in a different way. What are the best solutions? What would you recommend me?

Edit:

I forgot to say, but I will have physically all the devices used by my company for installing the application, so maybe there is a way to overpass the restriction by tricking the Android pad?

Community
  • 1
  • 1
Dimitri
  • 304
  • 3
  • 16

2 Answers2

3

That stands for localStorage and the built in SQLite database. I would suggest you taking a look at the File API, which would allow you to store files in the device.

davids
  • 6,259
  • 3
  • 29
  • 50
  • This sounds old for an offline HTML5 application. Isn't it possible to install a SQLlite or something ? – Dimitri Aug 20 '12 at 15:32
  • 2
    Old? The File API is a HTML5 feature, as the WebSQL Database, which has a limit of 5mb. If you wanted to use a native SQLite DB, you'd have to use a PhoneGap plugin, having in account that you'd need a different one for each device (Android, iOS, etc.). Take a look at this question http://stackoverflow.com/questions/9118757/max-size-of-websql-sqlite-database-inside-uiwebview-phonegap – davids Aug 20 '12 at 15:45
  • 2
    "Sounds old"? What is that even supposed to mean? – ceejayoz Aug 20 '12 at 15:46
2

There's a neat SQLite plugin here I'm using in an iOS/Android Phonegap application. I've tested it and found it's methods to work well on both platforms.

As for syncing JSON data and Base64 images, I'm doing this same thing with a SQLite DB managed through this plugin. I only have a couple hundred smaller images I'm working with but I've found the SQLite DB to be pretty reliable for this purpose.

Thanks to the authors of that plugin.

Benjamin Oman
  • 1,654
  • 1
  • 17
  • 19