MVC (Model-view-controller): M refers to the logical model, v refers to the view model, and C is the controller:
Android also uses the more popular MVC framework in Android:
A. View layer: The general use of XML file interface description, when used can be very convenient to introduce. Of course, if you know more about Android, you can think of Android can also use javascript+html and other ways as the view layer, of course, there is a need for Java and JavaScript communication between, fortunately, Android provides an implementation of very convenient communication between them.
B. Control layer (Controller): The task of Android's control layer usually falls on the shoulders of many activities, which implies not to write code in activity, to be processed by activity delivery model business logic layer, as long as the other reason is Android The response time of the activity is 5s. If the time-consuming operation is put here, the program can easily be recycled.
C Model: The operation of the database, the operation of the network, etc. should be processed in the model, of course, business computing and other operations must be placed in the layer.
Data binding in the Android SDK also uses a similar approach to the MVC framework to display the data. Data binding is achieved by encapsulating the data in the control layer as required by the view model (that is, the adapter in the Android SDK) to be displayed directly on the view model. For example, the listactivity of all the data in the cursor, the view layer is a ListView, the data is encapsulated as ListAdapter, and passed to the ListView, the data is in the ListView reality.
The MVC mode of Android