Why do we use xml?

We create many XML files for one application in the development of applications for Android; Of course, this is the main theme of the android. For each application screen, we create XML with some layouts (static implementation). When executed, every time an XML file is read, to get all the resources that it wants to display on the screen that we developed.

The same design can be achieved by adding a few lines in the Java code itself (dynamic implementation). For example, we can extend ListActivity instead of creating an XML file, for example. Then why go to XML, since the application must read the file from the phone’s memory, which can lead to slow access and slow down the application?

Thus, a dynamic implementation is always better than a static one.

Please correct me if I am wrong.

+5
source share
6 answers

XML files are highly recommended because it makes your application more closely monitor the Model-View-Controller programming strategy. Having each part as separate from each other, whenever possible, facilitates the development and maintenance of your overall program. The difference in performance seems minimal, although others have said that XML is preprocessed.

+1
source

It helps to organize and visualize layouts very beautifully. It provides a framework for gui that allows multiple devices to support much less code.

+5
source

, , Java-.

, , XML .

XML , . .

XML , . , ,

0

Android:

http://developer.android.com/guide/topics/ui/declaring-layout.html

XML , , . , , , . , XML , . , XML , . , XML

(XML ). , . , , , , ecc.. XML.

0

XML , , , , , , . XML - LinearLayout, , XML , , , .

0

XML

Android , , XML.

, XML , Eclipse Android aapt, XML . , XML, . , XML, IDE, . JSON, , . R.java IDE, , .

0

All Articles