Fast Forward

Whew, that was a lot to cover in one chapter! Starting from scratch, you learned how to use layout files to organize your user interface and how to use Android resources for text, colors, and more. You added controls such as buttons and text fields, applied themes to change the program's appearance, and even added menus and preferences for good measure.

7. This is optional if you're using the emulator but is required on a real device. Just remember to remove the option before releasing your code to the public.

Android is a complex system, but you don't have to know all of it to get started. When you need help, the hundreds of pages of reference material online go into more depth on all the classes and methods used here.8 Another great source for tips and tricks is Planet Android.9 And of course, if you get stuck, you can always drop by the discussion forum for this book.10 The other readers and I will be happy to help you out.

In Chapter 4, Exploring 2D Graphics, on the following page, we'll use Android's graphics API to draw the tiles for the Sudoku game.

8. To view the online documentation, open the docs subdirectory of your Android SDK install directory, or point your browser to



Chapter 4

So far, we've covered the basic concepts and philosophy of Android and how to create a simple user interface with a few buttons and a dialog box. You're really starting to get the hang of this Android thing. But something is missing...what is it? Oh yeah, the fun!

Good graphics can add a bit of fun and excitement to any application. Android puts one of the most powerful graphics libraries available on a mobile device at your fingertips. Actually, it puts two of them there: one for two-dimensional graphics and one for three-dimensional graphics.1

In this chapter, we will cover 2D graphics and apply that knowledge to implement the game part of our Sudoku example. Chapter 10, 3D Graphics in OpenGL, on page 198 will cover 3D graphics using the OpenGL ES library.

0 0

Post a comment