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

Android MVC

I thank Ben for presenting the Android listview project in such a clear an concise manner. However after introducing the concepts of MVC at the start of the unit, Ben lumped all the code together in 1 big activity plus 1 small view. I was hoping to see an app structured on the mvc pattern (using custom events & messages)... Now THAT would be a real intro to professional android development. eg:

  • Model class is observable
  • View class is observer
  • Controller class (main activity)
    • instantiates model and view
    • binds model and view
    • manages user input

<br>Just my 2cents worth ... Ron B, Australia.

2 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Hi Ron,

I do want to create more advanced MVC apps in the future. The Crystal Ball app is meant for total beginners, though, so I don't want to overwhelm students with too many details. The MVC stuff in that project is simply a gentle introduction to the concepts. :smile:

Great feedback and advice, though. I will definitely cover more professional-grade stuff in the future!

A quick update on MVC android apps.

As an android noob but experienced mvc developer in other languages, I just had to give this a go myself. Using the Observer design pattern, I developed a MVC version of Ben's BlogReader app and it turned out to be much easier than I originally thought. Any feedback is welcome.

Here is a link to the project if anyone is interested: BlogMVC.zip Take a look how clean the controller (MainActivity.java) ended up.

Note: I do not use eclipse (ADT) but it should build OK. I'm a Linux guy and use Netbeans IDE or Geany/Gradle for android development.