A (175)

(Tuis.) #1

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


It is important to note that this AndroidManifest.xml application characteristics definition file works
in exactly the same way, whether you are developing for 32-bit Android 4.x OS devices, or for 64-bit
Android 5.x OS devices.


As you progress in your knowledge of Android, in this chapter this will be your knowledge of XML,
you will continue to enhance the application foundation that you put into place in the previous
chapter into something that is truly impressive, learning every corner of the Android OS as well as
the Eclipse ADT Integrated Development Environment (IDE) in the process.


Extensible Markup Language: XML Overview


XML stands for eXtensible Markup Language. Extensible means that you can use it for whatever
you like (think customizable); you could create your own XML set of tags for any purpose that you
wish. It is a markup language because it uses simple “tags” to define what you wish to do. Most
of you will be familiar with another markup language called HTML, or Hypertext Markup Language,
which is used for creating HTML5 web sites and more recently for HTML5 application design.


Markup languages differ from programming languages in that they use tags, parameters (also
called attributes) within these tags, and nesting structures to accomplish tasks that a higher-level
programming language such as Java will implement using more complex programming structures,
such as arrays, loops, and methods. We will be getting into Java and these types of constructs in the
next chapter. You are really learning two programming languages, one that uses code, and the other
that uses markup, over the duration of this book.


The reason for this approach, that is, using XML for everything that could possibly be construed as
being design-oriented, is that using XML frees the members of your application development team
who are designing the application’s purpose, features, user interface, user experience, style and
theme, graphics, and the like, from having to learn, or even understand, how the Java programming
language works.


As you will soon see, when you compare this chapter to the next one on Java, XML markup is an
order of magnitude easier to learn and leverage than Java programming structures and concepts
are. For this reason, during this book, I am going to implement everything that I possibly can
using XML markup, so that I can get you to an intermediate level of Android 4.x and Android 5.x
application development in less than 700 dense pages of learning!


Although I’d like to take all the credit for this book being able to take you so very far from Absolute
Beginner to Android Developer, the primary reason that this is possible is because Google Android
OS developers allowed most of the advanced “front-facing” features, which allow you to ratchet up
the wow-factor of your applications, to be designed and implemented entirely using XML, using only
a line or two of Java programming logic!


Some examples of advanced Android design-related features that you can implement primarily using
XML markup “definitions” include: multi-state graphics, skinned UI elements (custom graphic design
UIs), frame or bitmap animation, vector or tween (procedural) animation, user interface layout design
animation (UI parameter animation), options menus, pop-up menus and context-sensitive menus,
dialogs, alerts, styles, themes, and more.


You can also implement less advanced design features using XML, including string (text) values
for your app, integer (numeric) values, state or status (boolean) values such as on or off, visible or
hidden, true or false, and screen spacing (dimension) values for your UI designs. Arrays, which are

Free download pdf