Mohamed Gamal

Modular Secrets to Lightning-Fast Android Builds

What if you could stop unnecessary recompilations? Learn the modularization patterns that unlock lightning-fast Android builds and boost developer efficiency.

Modular Secrets to Lightning-Fast Android Builds
#1about 2 minutes

The daily struggle with slow Gradle builds

Slow and failing Gradle builds are a common frustration for Android developers that can be solved with better project architecture.

#2about 3 minutes

How modularization enables incremental builds

Splitting a monolithic project into smaller, independent sub-projects allows Gradle to use incremental builds and only recompile what has changed.

#3about 3 minutes

Using `implementation` instead of `api` for dependencies

The `api` configuration leaks transitive dependencies to downstream modules, causing unnecessary recompilations, whereas `implementation` encapsulates them.

#4about 2 minutes

Breaking up generic "commons" modules

Generic "commons" modules violate the single responsibility principle and become a bottleneck for recompilation, so they should be split into smaller, feature-specific modules.

#5about 2 minutes

Splitting large feature modules for faster testing

Large, complex feature modules should be broken down into smaller submodules and paired with a dedicated sample app for faster, isolated testing.

#6about 1 minute

Using public API modules to reduce recompilation

For frequently changing domains, separate the stable public API with interfaces from the implementation to prevent cascading recompilations in dependent modules.

#7about 4 minutes

Removing dependencies with a navigation system

Eliminate direct module dependencies required only for navigation by implementing a centralized system using deep links or a custom navigator pattern.

#8about 5 minutes

Unifying build logic with Gradle convention plugins

Create custom Gradle convention plugins to centralize and reuse build configurations like Hilt, Detekt, and library settings across all modules.

#9about 2 minutes

Centralizing dependencies with version catalogs

Use a TOML-based version catalog to define all library versions and plugins in a single file, ensuring consistency and simplifying updates across the project.

#10about 2 minutes

Sharing version catalogs in a polyrepo setup

For projects spanning multiple repositories, create and publish a custom Gradle settings plugin to share a single version catalog and maintain dependency consistency.

Related jobs
Jobs that call for the skills explored in this talk.

test

Milly
Vienna, Austria

Intermediate

test

Milly
Vienna, Austria

Intermediate

Featured Partners

Related Articles

View all articles
CH
Chris Heilmann
All the videos of Halfstack London 2024!
Last month was Halfstack London, a conference about the web, JavaScript and half a dozen other things. We were there to deliver a talk, but also to record all the sessions and we're happy to share them with you. It took a bit as we had to wait for th...
All the videos of Halfstack London 2024!
LM
Luis Minvielle
Developers share the most interesting tech they ever built
Most people's first thoughts about Hacker News revolve around venture capital, stock prices, company valuations, and $1499 dongles. But what if we told you that Hacker News could also be a place for pure, consummate, wholesome content that tackles ho...
Developers share the most interesting tech they ever built

From learning to earning

Jobs that call for the skills explored in this talk.

Android Developer

Android Developer

Car2Go
Hamburg, Germany

Senior
Kotlin
RxJava
Android
User-centred Design
Dependency Injection
Android Developer

Android Developer

Cologne Intelligence

Remote
66-78K
Kotlin
Unit testing
Continuous Integration