Chapter 4

Android for Game Developers

Android's application framework is vast and confusing at times. For every possible task you can think of, there's an API you can use. Of course, you have to learn the APIs first. Luckily, we game developers only need an extremely limited set of these APIs. All we want is a window with a single UI component that we can draw to, and from which we can receive input, as well as the ability to play back audio. This covers all of our needs for implementing the game framework that we designed in the last chapter, and in a rather platform-agnostic way.

In this chapter, you'll learn the bare minimum number of Android APIs that you need to make Mr. Nom a reality. You'll be surprised at how little you actually need to know about these APIs to achieve that goal. Let's recall what ingredients we need:

  • Window management
  • Input
  • File I/O
  • Audio
  • Graphics

For each of these modules, there's an equivalent in the application framework APIs. We'll pick and choose the APIs needed to handle those modules, discuss their internals, and finally implement the respective interfaces of the game framework that we designed in the last chapter.

Before we can dive into window management on Android, however, we have to revisit something we discussed only briefly in Chapter 2: defining our application via the manifest file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.167.241