A (175)

(Tuis.) #1

130 CHAPTER 4: Introduction to XML: Defining an Android App, Its Design, and Constants


You can use XML markup to define a number of application new media assets, including 2D
animation, called Animation and AnimationDrawable objects in Android, as well as digital images,
or BitmapDrawable objects, and digital illustration, known as ShapeDrawable objects in Android.


XML object definitions get turned into Java objects using object inflation Java methods, and XML
files that are not object definitions can be utilized by your application as well using XML file parsing
methods such as the .XMLparse( ) method. The resulting Java objects and code is then run using
one of the two Android runtimes.


Summary


In this fourth chapter, you learned all about the XML markup language, as well as how the Android
platform utilizes XML markup to simplify the application development work process, so that non-
programmers can get involved.


You learned about how XML uses tags and parameters to define XML definition structures, as well
as how levels of nesting define what a parent and child XML tag is. You learned about the XML
naming schema, and how this is defined at the beginning of XML definition files.


Next you looked at some of the primary types of XML files that are utilized in an Android application,
by looking at the bootstrap XML files that were generated by the New Android Application Project
series of dialogs in the previous chapter. You examined, and in some cases edited, XML files defining
value constants, menu entries, application styles or OS themes, and the Android Manifest, which
defines your entire application.


You learned how to use the Run As ➤ Android Application work process and Run Configurations
dialog, and got used to compiling and running your HelloUniverse Android app using the Nexus One
AVD emulator. You looked at all of the major Holo OS themes, and looked at the inter-relationships
between all of these XML files at a high-level to see how they all relate to each other to create your
Android application user experience.


Finally, you learned how to use the visual editors, including the GLE, in Eclipse.


In the next chapter, you will learn all about the Java SE programming language by taking an in-depth
look at the Android application that you created in Chapter 3, including the java files in the /src/
folder. You will also learn how to create Java objects, classes, methods, and interfaces from scratch
for your Android application.


Figure 4-22. Android OS hierarchy from Linux Kernel, to Java Libraries, to XML Definitions, to New Media Assets

Free download pdf