1. Understanding of layeredness in Android system:
(1). In Android software development work, application developers mainly use the API encapsulated by the Android Application Framework layer for rapid development.
(2). Among the four levels of the Android framework, the lower layer is the upper layer service, the upper layer needs the support of the lower layer, and the upper layer needs to call the lower layer service.
(3). This layering method brings great stability, flexibility and scalability, allowing developers at different levels to concentrate on the development of specific layers according to specifications.
(4). Android's official recommendation is to adopt the MVC design model for the development of applications.
2. Understanding of MVC in Android:
(1). View layer: Generally, xml files are used for interface description, which can be introduced very conveniently when using it. Of course, if you have more knowledge about Android, you can think of using JavaScript+html and other methods as the view layer in Android. Of course, communication between Java and JavaScript is required here. Fortunately, Android provides a very convenient communication implementation between them.
(2). Controller: The heavy responsibility of the control layer of Android usually falls on the shoulders of many acitivity. This sentence implies not to write code in the activity, but to pass the model business logic layer through the activity. Another reason for this is that the response time of the activity in Android is 5s. If the time-consuming operation is placed here, the program will be easily recycled.
(3). Model layer: Operations of databases, networks, etc. should be processed in the model. Of course, operations such as business calculations must also be placed in this layer.
The general overview is as follows:
Model is the processing, operation and access of data.
The view displays data.
Activity plays an organizational role in the middle.
(1). In Android software development work, application developers mainly use the API encapsulated by the Android Application Framework layer for rapid development.
(2). Among the four levels of the Android framework, the lower layer is the upper layer service, the upper layer needs the support of the lower layer, and the upper layer needs to call the lower layer service.
(3). This layering method brings great stability, flexibility and scalability, allowing developers at different levels to concentrate on the development of specific layers according to specifications.
(4). Android's official recommendation is to adopt the MVC design model for the development of applications.
2. Understanding of MVC in Android:
(1). View layer: Generally, xml files are used for interface description, which can be introduced very conveniently when using it. Of course, if you have more knowledge about Android, you can think of using JavaScript+html and other methods as the view layer in Android. Of course, communication between Java and JavaScript is required here. Fortunately, Android provides a very convenient communication implementation between them.
(2). Controller: The heavy responsibility of the control layer of Android usually falls on the shoulders of many acitivity. This sentence implies not to write code in the activity, but to pass the model business logic layer through the activity. Another reason for this is that the response time of the activity in Android is 5s. If the time-consuming operation is placed here, the program will be easily recycled.
(3). Model layer: Operations of databases, networks, etc. should be processed in the model. Of course, operations such as business calculations must also be placed in this layer.
The general overview is as follows:
Model is the processing, operation and access of data.
The view displays data.
Activity plays an organizational role in the middle.