10-18-2013 01:02 AM
I am looking to do an app that has multiple lists (to be displayed on different pages). I've more or less figured out how to work with ListView etc. but I am still a noob and I just want to know what are the best practices if I want to create multiple lists.
Basically I have List A, B, C and I would like each item to have a checklist too. I have decided to use XML as my database.
My questions are:
1. Should I create separate xml database files for the individual lists, or save them all in one big list (and then just call them by the rootIndexPath? And I assume this is possible?).
2. I want to be able to update the list in the future, but I want to save any user input e.g. the checkbox input. What is the best way to do this? Must I create 2 different XML database for this? If so, how do I call on both of them at the same time and how should I join the 2 databases?
3. Is XML the best way to do this?
My data mostly consist of:
- Category (as sorted into List A, B, C already)
- Icon (for lists)
- (and potentially/ have not decided if I can do this yet), more Images.
Thanks in advance!!
10-18-2013 04:13 AM
I mostly use XML for static data, for data that needs to be manipulated and updated I recommend using sql.
1) I would switch to using sql now to save a lot of work in the future, with sql you don't need to worry about how many levels of hierarchy you have you just produce a different query for each result you desire.
2) You *can* join XML together using several of the datamodels provided but again I recommend switching to sql.
3) None of the formats really supports images that well (links to images yes), images can actually be stored in sql using the blob type.
Really in terms of dependency, recovery from failure, sql is the only real option for data that changes as the base of your app.
10-18-2013 06:49 AM
10-18-2013 08:00 AM
10-18-2013 03:09 PM
As BBSJdev says, SQL is probably the way to go. We have a few samples that use it like the Quotes sample app: https://github.com/blackberry/Cascades-Samples/tre
For images, what I would do is just store any images somewhere in the data folder of your app, and then just store the path as a string in SQL. You can store the actual image if you want, but Imageview and simliar classes work best with the file path, and this way it minmizes the size of the data you are putting in and puling out of SQL.
10-20-2013 03:54 AM
10-21-2013 01:42 PM
10-21-2013 01:52 PM