Welcome. If you've never written a line of code in your life, you are exactly who this book was written for. If you already know some programming but want to learn Kotlin and start building games on Android, you are also in the right place.
This book teaches Kotlin from absolute zero, and it does so by building games. Not boring command-line text apps, and not standard business apps with buttons and drop-down menus. We are going to build graphical, interactive experiences right from the start.
The complete code for this book is available at github.com/EliteIntegrity/Learning-Kotlin-by-Building-Android-Games.
Kotlin and Android Game Development
Kotlin is a fantastic language. It is concise, safe, and modern, and it is the official language for Android development. But when most people learn Android today, they immediately get bogged down in Jetpack Compose, view models, and complex UI layouts. That is perfectly fine if you want to build a banking app. But we want to build games.
So, we are going to do something different. We are going to completely ignore Jetpack and standard UI components. Instead, we are going to tap directly into the raw power of the Android screen using the Canvas and Paint APIs. We will draw our own graphics, handle our own touches, and build our own game loops.
This approach strips away the Android-specific magic and forces you to learn real, foundational programming: how to structure a program, how to manage state, and how to tell the computer exactly what to draw, frame by frame. By the time we introduce threads and sprite sheet animations in Act 3, you will understand exactly how games work under the hood.
AI-Assisted Coding
You have probably noticed the subtitle of this book. We are going to use AI to turbo-charge our development. But we are going to do it the right way.
If you don't understand the code an AI gives you, you are not a programmer — you are a hostage to whatever hallucination the LLM decides to spit out today. That is why the first three acts of this book focus entirely on building your core Kotlin and game programming skills. You need to know what a variable is, how a loop works, and how classes interact before you can effectively direct an AI.
Once you have that foundation, Act 4 will introduce "vibe coding" — an iterative, AI-assisted workflow where we build ambitious games much faster than we could alone. We will use AI to write boilerplate, generate systems, and expand our games, but we will do it as the boss, reviewing and understanding every line.
Let's get started.