Kick off your book project in 3 hours! Live workshop on Zoom. You’ll leave with a real book project, progress on your first chapter, and a clear plan to keep going. Saturday, May 2, 2026. Learn more…

Leanpub Header

Skip to main content

Mastering Android Systems: Architecture, Internals, and AOSP Foundations

Understanding core Android OS concepts

Minimum price

$19.00

$29.00

You pay

$29.00

Author earns

$23.20
$
You can also buy this book with 1 book credit. Get book credits with a Reader Membership or an Organization Membership for your team.
PDF
EPUB
About

About

About the Book

I have been developing Android apps on and off since 2015. This book is part of a series where i compile notes about how Android works under the hood.

I have always wanted a book that discusses the Android system in depth but not long enough to be boring.

I hope these notes will help you!

Share this book

Categories

Author

About the Author

Abdur-Rahmaan Janhangeer

Long-time Python and Open Source specialist.

Contents

Table of Contents

What Is This Book About?

Chapter 0: Android as a Distributed System on a Phone

  1. A different way to see Android
  2. Nodes and messages
  3. Process boundaries are failure boundaries
  4. Binder is not just IPC (Inter-Process Communication)
  5. ANR “App Not Responding” is not what you think
  6. Why this mental model matters
  7. A concrete analogy
  8. What you should take away
  9. A quick preview of what comes next

Chapter 1: Linux Foundations for Android Engineers

  1. 1.1 Scheduling: Who Gets the CPU, and When
  2. 1.2 Memory Pressure: The System Under Stress
  3. 1.3 Control Groups: Resource Isolation in Practice
  4. 1.4 I/O and the Hidden Cost of Waiting
  5. Chapter 2 Preview: App Lifecycle as a Resource Contract

Chapter 2: App Lifecycle Is a Resource Contract System

  1. 2.1 Lifecycle as Resource Arbitration
  2. 2.2 Process Killability and the OOM Model
  3. 2.3 Foreground Services and User Visibility
  4. 2.4 State Restoration as a Consistency Problem
  5. 2.5 The Bigger Picture
  6. Preview of the Next Chapter

Chapter 3: Prerequisites and First Contact with AOSP

  1. What Comes Next

Chapter 4: Binder Is the Real Android Architecture

  1. 4.1 Seeing Binder Clearly
  2. 4.2 The Lifecycle of a Binder Transaction
  3. 4.3 Thread Pools and Starvation
  4. 4.4 Death as a First-Class Concept
  5. 4.5 From HIDL to AIDL
  6. 4.6 Thinking in Binder
  7. 4.7 A Real Scenario
  8. 4.8 What to Take Away
  9. A Small Preview of What Comes Next

Chapter 5: System Server Is Android’s Control Plane

Chapter 6: The Rendering Pipeline

  1. 6.1 From Touch to Pixels: The Full Journey
  2. 6.2 Choreographer: Frame Scheduling in the UI Thread
  3. 6.3 The UI Thread: Where Most Mistakes Happen
  4. 6.4 The Render Thread: Decoupling Work
  5. 6.5 SurfaceFlinger: The System Compositor
  6. 6.6 Frame Budgeting: The Reality of Time
  7. 6.7 Understanding Jank Properly
  8. 6.8 Where Composition Actually Happens
  9. 6.9 A More Useful Mental Model
  10. What Comes Next

Chapter 7: Making Your First AOSP Change and Flashing

  1. 7.1 The First Change: Touching the System
  2. 7.2 Build Pipeline Mental Model
  3. 7.3 Rebuilding the System
  4. 7.4 Flashing to Emulator
  5. 7.5 Flashing to a Real Device
  6. 7.6 What Are Vendor Blobs
  7. 7.7 Build Variants and Why They Matter
  8. 7.8 Common Failure Modes
  9. 7.9 What You Just Achieved
  10. Next Chapter Preview

Chapter 8: Storage is a Consistency System

  1. 8.1 Internal vs External Storage
  2. 8.2 Scoped Storage and Access Models
  3. 8.3 Write Amplification in Mobile Storage
  4. 8.4 SQLite WAL Internals
  5. 8.5 Storage as a Consistency Contract
  6. Next Chapter Preview

Chapter 9: Android Security Model as a Layered Sandbox

  1. 9.1 The First Boundary: UID Sandboxing
  2. 9.2 SELinux: The Mandatory Policy Layer
  3. 9.3 IPC as an Attack Surface: Intents and Components
  4. 9.4 APK Signing and Verified Boot
  5. Chapter Summary
  6. Next Chapter Preview

Chapter 10: Boot Flow as a Dependency Injection System

  1. 10.1 Bootloader to Kernel to Init to Zygote
  2. 10.2 init.rc Scripts as Declarative Dependency Graphs
  3. 10.3 Service Dependency Graph
  4. 10.4 Zygote as a Preloaded Dependency Container
  5. 10.5 system_server as Late-Stage Injection Hub
  6. 10.6 Early Boot Race Conditions
  7. 10.7 Debugging Boot with logcat and Early Logs
  8. 10.8 Putting It Together

Chapter 11: Basic Debugging & Profiling (Foundation)

  1. 11.1: ADB as the Primary Observation Interface
  2. 11.2: logcat as a Multi-Channel Event Stream
  3. 11.3: dumpsys as Structured System Introspection
  4. 11.4: Memory Inspection and System Pressure Tools
  5. 11.5: First Performance Tracing with Perfetto and Systrace
  6. 11.6: First Integrated Debugging Workflow
  7. Chapter Summary
  8. About the next book

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub