Building the Game


This chapter is all about creating an Android game, exploring principles of optimization and getting your application ready for publication.

Source Code

The following .zip download contains the full source code for each programming example provided in this chapter.

Download the Source Code (Chapter 9)


1. EllioAndroid Checkpoint 1: Prepares the framework and adds all the needed assets. 

2. EllioAndroid Checkpoint 2: Fully implements the model classes for Ellio.

3. EllioAndroid Checkpoint 3:  Adds State classes, button handling, and swipe-based input.

4. EllioAndroid Checkpoint 4: Adds a Game Over screen.

5. EllioAndroid Checkpoint 5: Performs optimizations to reduce garbage collection.

6. EllioAndroid Complete: The full source code for the Ellio Android game. 

Importing Instructions:

Click Here to see how to import the above projects into your workspace.


The following .zip download contains all assets used in this chapter.

Download the Assets (Chapter 9)


iconimage.png, welcome.png, selector.png, cloud1.png, cloud2.png, runanim1.png, runanim2.png, runanim3.png, runanim4.png, runanim5.png, duck.png, jump.png, grass.png, block.png, onjump.wav, hit.wav

Additional Information

1. For a list of all known in-text errors, please see the Errata.

This section will be updated as needed. Please post on our forums if you need assistance or explanation on topics covered in this chapter.

2. If you are building on the Android Lollipop SDK (API 21+), the SoundPool constructor has been deprecated. This means that you will get a warning (not an error) in your Assets class. Your code will still work, but it is recommended that you make some changes. Please click here to learn more.