No description
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
AI guide
# Beginning Android Games — Reading Guide
## 【One-Line Pitch】
A practical, project-driven guide for Java developers who want to build 2D games for Android from scratch, covering everything from project setup and game design fundamentals to OpenGL ES rendering and publishing on Google Play. If you're a programmer with some Java experience who wants to ship a real Android game, this is your hands-on roadmap.
## 【Book Arc】
- **Opening (~0%–10%)**: Introduces Android's history, architecture (kernel, Dalvik runtime, system libraries, application framework), and the fragmentation problem — why developers must account for wildly different devices, screen sizes, and hardware capabilities. Sets the stage for why mobile gaming is a unique challenge.
- **Early (~10%–24%)**: Walks through the Android SDK and development environment — creating projects in Eclipse, running apps on emulators and physical devices, debugging with LogCat/DDMS, and using ADB. Also covers game design 101: genres (casual, puzzle, action, tower-defense, social), core mechanics, story/art style, and screen transitions.
- **Early (~24%–34%)**: Dives into Android API essentials for games — the Activity lifecycle, input device handling, file I/O, audio programming (sound effects vs. streaming music), and basic graphics programming. Establishes best practices for game code.
- **Middle (~34%–41%)**: Builds a reusable Android game development framework — an `AndroidFileIO` class, audio/sound/music abstractions, input handling with accelerometer and compass handlers. This is the foundation layer that all subsequent games will use.
- **Middle (~41%–45%)**: Presents the first complete game, "Mr. Nom" — a snake-like game. Shows the full architecture: main activity, asset store, settings/high-score persistence, loading screens, menu/help/high-score screens, and a Model-View-Controller world abstraction with Stain, Snake, and World classes.
- **Middle (~45%–52%)**: Introduces OpenGL ES for 2D graphics — the programming model, projections, matrices, the rendering pipeline, `GLSurfaceView`, and a `GLGame` class implementing the game interface. Covers vertices, alpha blending, primitives (points, lines, strips, fans), 2D transformations with the model-view matrix, and performance optimization via frame-rate measurement.
## 【Key Takeaways】
- **Android fragmentation is the central design constraint** (Early): Games must work across a huge range of devices with different CPUs, GPUs, screen sizes, and Android versions. The book's architecture choices — abstraction layers, compatibility checks, and careful API usage — all stem from this reality.
- **Game design precedes code** (Early): Before writing a single line, define core mechanics, story, art style, and screen transitions. The book treats design as a discipline, not an afterthought, and maps genres to their typical technical requirements.
- **The Activity lifecycle is the backbone of Android games** (Early): Understanding `onCreate`, `onPause`, `onResume`, and related callbacks is non-negotiable — games must handle interruptions (calls, notifications) gracefully or risk losing player progress and state.
- **A reusable framework saves enormous time** (Middle): The book builds `AndroidFileIO`, `AndroidAudio`, `AndroidSound`, `AndroidMusic`, and input handlers (including accelerometer and compass) once, then reuses them across games. This is the "write once, use everywhere" payoff of good architecture.
- **Model-View-Controller (MVC) works for games** (Middle): The Mr. Nom example separates game state (World, Snake, Stain classes) from rendering (GameScreen) and input handling. This keeps logic testable and screens swappable — a pattern worth copying for any game.
- **OpenGL ES is the path to real performance** (Middle): The book transitions from Canvas-based drawing to OpenGL ES for 2D, covering projections, matrices, vertices, alpha blending, and transformations. The payoff is hardware-accelerated rendering and control over the graphics pipeline.
- **Performance measurement is a habit, not a step** (Middle): Frame-rate measurement and optimization techniques (like batching vertices) are introduced early in the OpenGL chapters, emphasizing that performance must be tracked continuously, not retrofitted at the end.
## 【Reading Tips】
- **Skim the Android history and architecture chapter** (~0%–10%) if you're already familiar with Android basics — it's context, not actionable code. But do read the fragmentation discussion; it explains every compatibility decision later in the book.
- **Deep-read the framework chapter** (~34%–41%): This is the architectural heart of the book. Understanding how `AndroidFileIO`, audio, and input are abstracted will make the Mr. Nom game and all later examples much easier to follow.
- **Treat Mr. Nom as a template** (~41%–45%): Don't just read it — trace how the MVC pattern flows from the main activity through screens to the world model. This is the most transferable knowledge in the book.
- **The OpenGL ES chapters (~45%–52%) are the steepest climb**: If you're new to graphics programming, go slowly through projections, matrices, and the rendering pipeline. The "red triangle" example is deceptively simple — make sure you understand each step before moving on.
- **Skip the iOS/Xcode comparison section** (~31%) unless you're coming from Apple's ecosystem — it's a detour for a specific audience.
## 【Coverage Limits】
The excerpts cover roughly the first half of the book (through ~52%). Later chapters on the NDK, marketing, monetization, and publishing are listed in the table of contents but not covered in this guide's source material.
##
Page 3
as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date o...
View in text
Page 8
................... 18 A Gaming Machine in Every Pocket ........................................................................................................
View in text
Page 5
n> Element .............................................................................................................. 112 The <uses-feature> Element .......
View in text
Page 11
.............................................. 267 Summary .....................................................................................................
View in text
Page 13
ng Is Caring ........................................................................... 408 An Example ........................................................
View in text
Page 15
............................................................ 530 Lighting in OpenGL ES .........................................................................
View in text
Page 6
ng the Shared Library ................................................................................................ 640 Putting It All Together .............
View in text
Page 19
.badlogicgames.com, or follow him on Twitter @badlogicgames. Robert Green is the founder of the game studio Battery Powered Games in Portland, Oregon. He has...
View in text
Tags
AI categories
ProgrammingMobilegame development
Text Preview (First 20 pages)
Registered users can read the full content for free
Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.
Generating text preview…
Loading comments...
Reply to Comment
Edit Comment