Why does Android use the xml Description Interface? androidxml description

Source: Internet
Author: User

Why does Android use the xml Description Interface? androidxml description

XML can completely separate the content and structure of a program. It can completely separate content management from process management, reduce development coupling, and facilitate project management. In addition, XML has a unified standard syntax. All XML documents supported by any system and product have a unified format and syntax, which is conducive to cross-platform migration and high scalability. With Swing mode, the coupling is high, and the maintenance cost is higher than that of XML.
Xml is a universal international standard (if you can create such a standard). Now, almost all computer languages use xml and will deal with it; the use can achieve the separation of the interface and code (reduce coupling and portability); swing is only part of the Java class library, if you use swing, it is better to use Java directly.

It is best to write the Android layout in the res/layout folder in xml format. This not only separates the foreground interface from the business logic, but also makes the code clearer,
More importantly, it facilitates model adaptation and internationalization of apps.

Putting these controls into an xml file is an important aspect for android to ensure the MVC Architecture. The layout is the View layer, which is isolated from the logic code,
So it's better to put it in an xml file? However, some dynamic controls cannot be put into java code!

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.