Your Cart
Loading

Structure That Scales: Modules, Hilt, Convention Plugins, Clean Layers and Navigation for Android Apps That Grow

On Sale
$19.00
$19.00
Added to cart

Structure That Scales is a practical guide to the moment an Android app outgrows one module: builds that recompile half the app for a one-line change, daily merge conflicts, screens that cannot be tested without the real database, and nobody sure where new code goes. It starts where Compose Without the Confusion stops, with a single-module app and hand-written dependency passing, and turns it into a structure that grows well. You give every class a layer, split the app into app, feature and core modules with implementation dependencies and internal implementations, wire them with Hilt and KSP on AGP 9, move build configuration into convention plugins in a build-logic included build with one version catalog, navigate between feature modules with Navigation 3 without any feature importing another, build an offline-first data layer with repository interfaces, mappers, sealed error types and injected dispatchers, share UI through :core:designsystem and :core:ui, test with fakes and test dispatchers, and keep the build fast and the module graph healthy with Gradle's caches, profiling and a graph check in CI. Everything is applied to one fictional notes app, Field Notes, and finishes with a five-stage migration plan you can follow in your own app. Every library and plugin version, API and default was checked against the official Android Developers pages, Dagger and Gradle documentation, the release pages and Maven repositories in November 2026, and Now in Android is cited only for the files that were actually read.

What you get

  • Before We Start: the symptoms of an app that has outgrown one module, where this book starts (one module and manual DI) and the versions it uses
  • Layers that mean something: UI, optional domain and data layers, unidirectional data flow, and a table for where every kind of class goes
  • Modules with clear boundaries: app, feature and core modules, api vs implementation, pure Kotlin modules, internal by default, and feature api/impl splits
  • Hilt across modules: KSP setup on AGP 9, @HiltAndroidApp, @AndroidEntryPoint, hiltViewModel() from hilt-lifecycle-viewmodel-compose, assisted ViewModels, @Binds vs @Provides, scopes, qualifiers, classpath aggregation and testing with fakes
  • Convention plugins and the catalog: a build-logic included build, configureKotlinAndroid with AGP 9's unparameterized CommonExtension, library, Compose, feature, Hilt and JVM plugins, and a version catalog shared with build-logic
  • Navigation across modules: Navigation 3 keys and entries per feature, a back stack owned by the app module, per-entry ViewModel stores, IDs instead of objects, results, deep links, and the Navigation 2 equivalent
  • The data layer for real: repository interfaces with internal implementations, data sources, offline first, three models and two mappers, sealed error types, and injected dispatchers and clocks
  • Shared UI: :core:designsystem vs :core:ui, theme and spacing tokens, component guidelines, previews in modules, and resources with non-transitive R classes
  • Testing a modular app: a :core:testing module, fakes instead of mocks, MainDispatcherRule and test dispatchers, ViewModel tests, and Hilt test rules with @TestInstallIn
  • Build speed and health: configuration cache, build cache and parallel builds, measuring with --profile and Build Scans, a graph check script for CI and the Dependency Analysis Gradle Plugin
  • Putting it together: the finished Field Notes module graph, one user action traced through every layer, and a five-stage migration plan that keeps the app shippable, plus a Modular App Checklist and a cheat sheet

76 pages, 24 diagrams plus a chapter-opener graphic for every chapter, a modular-app checklist and a cheat sheet. PDF and EPUB. Android the Right Way, Book 11.

Not sure yet? Read the free sample first: the cover, the full table of contents and all of Chapter 3, "Hilt Across Modules" (setting up Hilt with KSP on AGP 9, @HiltAndroidApp and @AndroidEntryPoint, @HiltViewModel with hiltViewModel() from hilt-lifecycle-viewmodel-compose, assisted injection for a ViewModel keyed by note ID, @Binds vs @Provides, components and scopes, a dispatcher qualifier, Hilt across Gradle modules with classpath aggregation, testing with fakes, @TestInstallIn and @BindValue, and the common mistakes), at https://payhip.com/b/TH98B


Also in a bundle: Everything Bundle: every ebook in the store, $89 ยท Android Bundle, $49.

You will get the following files:
  • PDF (3MB)
  • EPUB (4MB)