0
votes

I am building a mobile application for Android and iOS with PhoneGap, jQuery Mobile and jQuery

The type of information I want to save is, UTF-8 text information, roughly 500 words

Should I go with IndexedDB or HTML5 storage?

Is 500 words too small for IndexedDB?

I read that IndexedDB is only compatible with Android 4.4 or higher and iOS 7 or higher. The Google Chrome on my Android device is 36 but the Android OS is 4.1.2 but IndexedDB appears to be compatible with my phone.

Or should I go with Polyfill/WebSQL?

1

1 Answers

0
votes

It depends with what you want but don't forget that because indexedDB is async code might get complex because all dependent code now needs to be async too, so it will be a bit of a callback hell or a lot of promises.

So in my opinion if the size is under a few megs you might be better of with the sync localstorage solution.

About indexedDB:

IndexedDB won't work with android 4.3 and below so you need a polyfill for indexedDB (like you already said in your post). The indexedDB object exists on those devices but it is actually an older spec. I can recommend https://github.com/axemclion/IndexedDBShim if you go for the shim solution for older devices.