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
Allan Evans
9,501 PointsPersonal Java App Project/Date checker
Hey guys I was planning on doing an app using the MVC architecture used in the Android app tutorial and I was wondering if there was anything I should consider when making it. The idea is that a manager friend of mine who works in retail has to constantly look for out of date produce and other refrigerated items. I was planning on making an app that takes the item number, dates, and location (all from a spread sheet that he has made already) and use that as the model, the phone as the view, and use the controller to make custom alerts to let him know where to look instead of going through everything piece by piece.
Let me know what you think and give me some suggestions if you want.
1 Answer
Ben Jakuben
Treehouse TeacherHi Allan,
Sounds like a cool project! So you sound like you're set with your data and model. You have the spreadsheet as your data source, and you can import it into your app. For MVC, you would want to create a Model that reflects the data in the spreadsheet, so perhaps something like an RefrigeratedItem class that has item number, date, and location as properties of it.
Your View is how you present the model to the user. So in Android, the View component would be your Activity layouts. For this app, maybe you have a list view that shows items in reverse chronological order or something.
Lastly, the Controller is the guts that do all the work to prepare the Model for the View. So in this case, once you have the data in the Model (say, an Array of RefrigeratedItems), then the Controller will be your Activity where you manipulate the data and get it ready to be displayed.
Let me know if that sounds reasonable or if you have any questions!