An understanding of MVC design patterns in Android development
1. Layered Understanding in Android:
(1). In the development of Android software, the developers of the application are mainly using the Android application framework layer packaged API for rapid development.
(2). In the Android framework of the four levels, the lower layer for the upper level of service, the upper layer requires lower support, the upper layer needs to call the lower service.
(3). This layered approach brings great stability, flexibility and scalability, allowing developers of different tiers to focus on specific layers of development in accordance with specifications.
(4). Android's official recommendation application is developed using MVC design patterns.
2. The understanding of MVC in Android:
(1). View layer: The general use of XML file interface description, when used can be very convenient to introduce, of course, how you learn more about Android, you can think of Android can also use javascript+ HTML and so on as the view layer, of course, there is a need for the communication between Java and JavaScript, fortunately, Android provides a very convenient communication between them implementation.
(2). Control layer (Controller): The task of Android control layer usually falls on the shoulders of many acitvity, this phrase also implies do not write code in acitivity, to through activity delivery model business Logic layer processing, Another reason for this is that the response time of Acitivity in Android is 5s, and if time-consuming operations are put here, the program is easily recycled.
(3). 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 on the layer. The general overview of
is as follows:
model is the processing, operation, access to the data.
View is the data that is displayed. The
activity plays an organizational role in the middle.
MVC Design Patterns in Android development