Reputation: 5164
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:
Note that for a first implementation I would like the app to work offline.
Ideally the data is persistent and survives OS upgrades etc.
Upvotes: 0
Views: 69
Reputation: 397
You could use WebSQL to create a database to store this information. The only downside is you are limited to 5mb. It should survive the user updating, but like localstorage may not survive if the user clears his/her cache. (At least this used to be a problem. I have not checked the newer versions of phonegap to see if it is still an issue.)
You might also consider making a plugin to use the SQLite database on your target platform. Move all of your db logic to the plugin, and manipulate and retrieve your data as an object.
EDITED: Actually I just found a plugin that already adds SQLite storage to a Cordova/Phonegap app.
Upvotes: 2