Chapter 9. Graphics and animation

 

This chapter covers

  • Drawing graphics in Android
  • Applying the basics of OpenGL for embedded systems (ES)
  • Animating with Android

One of the main features of Android that you should’ve picked up on by now is how much easier it is to develop Android applications than it is to use other mobile application platforms. This ease of use is especially apparent when you’re creating visually appealing UIs and metaphors, but there’s a limit to what you can do with typical Android UI elements (such as those we discussed in chapter 3). In this chapter, we’ll look at how to create graphics using Android’s Graphics API, develop animations, and explore Android’s support for the OpenGL standard. (To see examples of what you can do with Android’s graphics platform, go to http://www.omnigsoft.com/Android/ADC/readme.html.)

First, we’re going to show you how to draw simple shapes using the Android 2D Graphics API, using Java and then XML to describe 2D shapes. Next, we’ll look at making simple animations using Java and the Graphics API to move pixels around, and then using XML to perform a frame-by-frame animation. Finally, we’ll look at Android’s support of the OpenGL ES API, make a simple shape, and then make a more complex, rotating, three-dimensional shape.

9.1. Drawing graphics in Android

9.2. Creating animations with Android’s Graphics API

9.3. Introducing OpenGL for Embedded Systems

9.4. Summary