Introducing the model-view-controller pattern
The phrases model, view, and controller reflect the separation of the different parts of our app into distinct sections, called layers. Android apps commonly use the model-view-controller pattern. A pattern is simply a recognized way to structure code and other application resources, such as layout files, images, and databases.
Patterns are useful to us because, by conforming to a pattern, we can be more confident that we are doing things right, and will be 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 just an understanding of the MVC pattern will be enough to create some professionally built Android apps.
We have been partly using MVC already, so let's look at each of the three layers in turn.
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...