
v
Contents at a Glance
About the Authors �������������������������������������������������������������������������������������������������������� xix
About the Technical Reviewer ������������������������������������������������������������������������������������� xxi
Acknowledgments ����������������������������������������������������������������������������������������������������� xxiii
Introduction ���������������������������������������������������������������������������������������������������������������� xxv
Chapter 1: An Android in Every Home ■ �������������������������������������������������������������������������1
Chapter 2: First Steps with the Android SDK ■ �������������������������������������������������������������21
Chapter 3: Game Development 101 ■ ���������������������������������������������������������������������������55
Chapter 4: Android for Game Developers ■ ����������������������������������������������������������������107
Chapter 5: An Android Game Development Framework ■ ������������������������������������������193
Chapter 6: Mr� Nom Invades Android ■ �����������������������������������������������������������������������237
Chapter 7: OpenGL ES: A Gentle Introduction ■ ����������������������������������������������������������275
Chapter 8: 2D Game Programming Tricks ■ ���������������������������������������������������������������355
Chapter 9: Super Jumper: A 2D OpenGL ES Game ■ ���������������������������������������������������433
Chapter 10: OpenGL ES: Going 3D ■ ����������������������������������������������������������������������������493
Chapter 11: 3D Programming Tricks ■ �����������������������������������������������������������������������529
Chapter 12: Android Invaders: The Grand Finale ■ �����������������������������������������������������583
www.it-ebooks.info

Contents at a Glancevi
Chapter 13: Going Native with the NDK ■ �������������������������������������������������������������������633
Chapter 14: Marketing and Monetizing ■ �������������������������������������������������������������������649
Chapter 15: Publishing Your Game ■ ��������������������������������������������������������������������������659
Chapter 16: What’s Next? ■ ����������������������������������������������������������������������������������������675
Index ��������������������������������������������������������������������������������������������������������������������������� 679
www.it-ebooks.info

xxv
Introduction
Hi there, and welcome to the world of Android game development. You came here to learn
about game development on Android, and we hope to be the people who enable you to realize
your ideas.
Together we’ll cover quite a range of materials and topics: Android basics, audio and graphics
programming, a little math and physics, OpenGL ES, an intro to the Android Native Development
Kit (NDK), and finally, publishing, marketing, and making money from your game. Based on all
this knowledge, we’ll develop three different games, one of which is even 3D.
Game programming can be easy if you know what you’re doing. Therefore, we’ve tried to
present the material in a way that not only gives you helpful code snippets to reuse, but actually
shows you the big picture of game development. Understanding the underlying principles is the
key to tackling ever more complex game ideas. You’ll not only be able to write games similar
to the ones developed over the course of this book, but you’ll also be equipped with enough
knowledge to go to the Web or the bookstore and take on new areas of game development on
your own.
Who This Book Is For
This book is aimed first and foremost at complete beginners in game programming. You don’t
need any prior knowledge on the subject matter; we’ll walk you through all the basics. However,
we need to assume a little knowledge on your end about Java. If you feel rusty on the matter,
we’d suggest refreshing your memory by reading Thinking in Java, by Bruce Eckel (Prentice Hall,
2006), an excellent introductory text on the programming language. Other than that, there are no
other requirements. No prior exposure to Android or Eclipse is necessary!
This book is also aimed at intermediate-level game programmers who wants to get their hands
dirty with Android. While some of the material may be old news for you, there are still a lot of tips
and hints contained that should make reading this book worthwhile. Android is a strange beast
at times, and this book should be considered your battle guide.
www.it-ebooks.info