mardi 5 mai 2015

Storage in a phonegap app

I am building an application that uses Phonegap. This is an application for learning Hiragana and Katakana (Japanese scripts).

So far it only displays a set of static data, but I want to have the user to be able to modify the data.

At the moment the static data is contained in JSON. There are 46 characters in total:

[
  {
      "id": 0,
      "name": "a",
      "hiragana": "あ",
      "katakana": "ア",
      "row": "a"
  }
]

I want the user to be able to set a confidence level:

[
  {
      "id": 0,
      "confidencelevel": 4
  }
]

I am currently using localStorage to store some user preferences but this is just a key/value pair.

I am looking for some advice on:

  • Should I split the data: user data/static app data and use the id as the reference point between the two JSON files?
  • Data storage: how to store the data in a sensible format that I can easily retrieve?

Note that for a first implementation I would like the app to work offline.

Ideally the data is persistent and survives OS upgrades etc.

Aucun commentaire:

Enregistrer un commentaire