An analysis of MVC design pattern in Android development _android

Source: Internet
Author: User

An understanding of MVC design patterns in Android development

1. Layered understanding of the Android system:
(1). In the Android software development effort, application developers are mainly using the Android application framework layer encapsulated API for rapid development.
(2). In the four tiers of the Android framework, the lower layer is the upper level service, the upper layer needs the lower support, and the upper layer needs to invoke the lower service.
(3). This layered approach brings great stability, flexibility, and scalability, enabling developers of different layers to focus on specific layers of development in accordance with the specification.
(4). Android's official recommended application development uses MVC design patterns.
2. Understanding of MVC in Android:
(1). View layer: Generally use XML file to describe the interface, the use of time can be very convenient to introduce, of course, how you know 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 to communicate between Java and JavaScript, fortunately, Android provides a very convenient communication implementation between them.
(2). Control layer (Controller): The weight of the Android control layer usually falls on the shoulders of many acitvity, which implies that you do not write code in acitivity, you have to deal with the activity delivery model business logic layer, Another reason for this is that the acitivity response time in Android is 5s, and if the time-consuming operation is placed here, the program can easily be recycled.
(3). Model layer: The operation of the database, the network operation should be in the model inside processing, of course, business calculation and other operations must also be placed on the layer.
The general overview is as follows:
Model is the processing of data, operations, access.
View is the display of data.
Activity plays an organizational role in the middle.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.