A (175)

(Tuis.) #1
CHAPTER 3: An Introduction to the Android Application Development Platform 83

Android Anim: Assets Defining Tween Animation


Besides frame animation, also known as bitmap animation or raster animation, Android OS also
supports vector animation, which it terms tween animation. This type of animation is what is
known in the industry as procedural animation, and is created using Java code or XML markup
parameter definitions rather than by “flipbooking” through a collection of images (frames) to create
an illusion of motion.


Whereas Bitmap Animation in Android uses the BitmapAnimation class, Tween Animation in Android
uses the Animation class, and thus the proper folder to contain resources or assets related to
procedural animation is not the /res/drawable/ folder, but instead the /res/anim/ folder, which you
will have to create in order to utilize this type of animation in Android. Fortunately we will be covering
this in Chapter 10, so you’ll create this folder then.


Android Animator: Asset for Property Animation


There is a third type of animation in Android, called property animation, used to animate
“properties” or “parameters” for any of your UI widgets or even your entire UI design. You can
use this to obtain impressive special effects that entice your end-users. Property Animation XML
definition files are held in the /res/animator/ folder, and reference the UI elements that you want to
animate as well as To and From values.


Android Raw: Pre-Optimized Video & Audio Files


The /res/raw/ folder in Android OS holds your application’s “raw data.” Raw data in Android is not
optimized (touched) in any way by the Android OS, it is simply played back (usually streamed) from
this folder “as-is.”


This is the folder that you want to contain your new media assets for which you have taken the time
to optimize the data footprint (file size) to quality ratio. This would be done outside of Android using
software packages such as Audacity or Lightworks, both of which you downloaded and installed
during Chapter 1.


We will be looking at how to create and leverage this /res/raw/ folder a bit later on in this book,
during Chapters 11 and 12, where I will cover the Android MediaPlayer and MediaController classes,
as well as how to create and play back digital audio and digital video new media asset resources
using this particular resource folder.


Android XML: Arbitrary XML and Configurations


The last resource folder that you should know about is the /res/xml/ folder, which is used to contain
XML files that specify configuration parameters that are external to (outside of) the scope of your
Android application, possibly relating to certain device hardware or similar. This folder can also
contain custom XML files that have nothing to do with the Android application creation process, but
that are “parsed” (read in) by your Android application using the Resources.getXML( ) method call.
We will cover Java method calls in Chapter 5.

Free download pdf