A <brief> Look at XML
IN THIS CHAPTER
What XML can do for you
What goes into an XML document
How XML handles the names of things
As described in the “Comparing the Functional Paradigm” section of Chapter 6 of this minibook, modern software takes on several forms, and Kotlin can express a number of them in a similar manner as other languages like Python do. One way or another, a development platform should use the best software for the job. That's why the Android platform uses both procedural and declarative software.
- Android's procedural Kotlin code tells a device what to do.
- Android's declarative XML code describes a layout, an application, a set of strings, a set of preferences, or some other information that's useful to a mobile device.
A typical Android application is a mix of Kotlin code (with Java underpinnings), XML code, and a few other things. So when you develop for Android, you write lots of Kotlin code and you mess with XML code.
What? You “mess with” XML code? What does that mean?
The truth is, XML code is painful to type. A typical XML file involves many elements, each requiring very precise wording and all looking very much alike at first glance. So ...