Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
jonathan sumner2,715 Points
How would I store data for a recipe app.
I am attempting to create an app that contains recipes. the "home page" of the app would have the type of food (mexican, italian, etc.) and when you click on one of those it would bring up the appropriate list of dish names. clicking on the dish name would bring up the recipe for the dish.
My question is where should I keep the data. I read the sqlite databases are best for this so I began dabbling in sql and now I am hoping that there is a better way. Would it be appropriate to store all if this data and the images within the app? It seams like a lot of data but I'm not sure if compiling the app for use would compress the data's size or not.
would it be better to add all of the data as strings or do I need a database. if I need to use a data base what would be the way that is best while being easiest for my novice abilities to accomplish?
Jonathan McCottry6,606 Points
The biggest question i have before you decide that would be related to scalability. How will your data be updated? Does the user have to get a new copy of your app to get new recipes?
If you have 10 recipes and there will only ever be 10, I, personally would do it in a database, just because I have only done it once and that probably would be an opportunity for me to get more skills on the subject. Strings are the "cheap and dirty" way imo and I am sure you already know how to do that.
If you are thinking about scaling this up a bit the self destructing app teaches how you can pull data from a back end like parse. Maybe you have an object called "recipe" and you could tag one of the fields as "type" and then you are pulling your pfquery from the object by "type"
Either way, let us know what you decide and I fully expect there to be a vegetarian section of this app ;)
Happy Coding!! JMc
jonathan sumner2,715 Points
I would like to say that I have chosen to used sqlite for a database but I have decided that I don't have the slightest clue on what I am doing so I am currently reading a very in depth text book covering java then I will move on to android development and maybe then I will be able to make sense of all of this.
thank you for your reply however. You reconfirmed my suspicions about using strings to store the data.