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! While you're at it, check out some resources Treehouse students have shared here.

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

Android

jonathan sumner
jonathan sumner
2,715 Points

How would I store data for a recipe app.

Hi everyone,

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?

2 Answers

You have a few different options for that. The best place for storage solutions for Android is http://developer.android.com/guide/topics/data/data-storage.html
It lists pretty much all (or most, I'm not sure) storage options, from internal to external storage. In my opinion though, database is usually best solution for a structured set of data (every recipe will have a set of values, such as type of food, name, ingredients etc). As to the easiest way to learn and implement an SQLite database... no tips here I'm afraid. When I was doing my dissertation I spent most of my time on the database, because SQLite is not the easiest, at least not to me and not compared to MySQL for example. But I hope you will get on with it and find good resources and tutorials to help you! :)

PS. I think the thing that helped me the most with databases was either this http://it-ebooks.info/book/1564/ or this book http://it-ebooks.info/book/905/ It showed a really easy and straightforward example of simple database operations

jonathan sumner
jonathan sumner
2,715 Points

Good stuff. Very Helpful. So the only way to create a database is to use sqlite then? That's a real pain. Does anyone know where I would begin to try and understand using a web type database such as a website?