Introducing the model-view-controller pattern
MVC refers to the separation of different aspects of our app into distinct parts called layers. Android apps commonly use the model-view-controller pattern. A pattern is simply a recognized way to structure our code and other application resources, such as layout files, images, databases, and so on. Patterns are useful to us because by conforming to a pattern, we can be more confident that we are doing things right and are less likely to have to undo lots of hard work because we have coded ourselves into an awkward situation.
There are many patterns in computer science, but an understanding of MVC will be enough to create some really professional Android apps.
We have actually been partly using MVC already, so let's take a look at each of the three layers in turn.
The model
The model refers to the data that drives our app and any logic/code that specifically manages it and makes it available to the other layers. For example, in our Note To...