0

I want to use Phonegap on firefox os but I have a problem on storage api. Current cordova version 3.0, supports websql and localstorage API. It doesn't have indexedDB API yet. So, my current option is to use Lawnchair.

But do you have a good idea on how to design a persistence layer for this. What can you suggest?

Please let me know. Thank you.

paolooo
  • 4,133
  • 2
  • 18
  • 33
  • What do you mean with 'design a persistance layer for this'? If you'd rephrase your question so that it would describe an actual problem you'd get more answers. – Jan Jongboom Aug 07 '13 at 10:20

2 Answers2

2

You might try using localForage:

https://github.com/mozilla/localforage

To quote, "localForage is a handy library that improves the offline experience of your web app by using asynchronous storage (via IndexedDB where available) but with a simple, localStorage-like API."

  • Cool. Thanks for sharing. As of today, this is still in beta version.. but will definitely look into to this one. I'm excited about it. I'll wait until it supports websql. Before, I was using brian's lawnchair but then got some issue on creating multiple records... then I decided to go with ydn-db. See this post http://stackoverflow.com/questions/17948230/lawnchair-indexeddb-doesnt-support-multiple-records. Thanks for the reply. :) – paolooo Dec 06 '13 at 03:09
1

If your app is for Firefox OS only you can use the indexedDB API directly, it's already supported without plugins.

For other platforms, there is a cordova indexdb plugin being developed that might help, you can find it on github here. It uses indexedDBShim which could also be helpful.

Rodms
  • 31
  • 5