Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The_Build_Side_of_Android_App.pdf
Search
Boris Farber
June 27, 2018
Programming
330
2
Share
The_Build_Side_of_Android_App.pdf
Boris Farber
June 27, 2018
More Decks by Boris Farber
See All by Boris Farber
Android Studio Poet
borisf
3
690
10 ways to improve your Android app performance
borisf
1
120
Other Decks in Programming
See All in Programming
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
370
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
16
5.6k
RSAが破られる前に知っておきたい 耐量子計算機暗号(PQC)入門 / Intro to PQC: Preparing for the Post-RSA Era
mackey0225
3
130
Vibe NLP for Applied NLP
inesmontani
PRO
0
260
Java 21/25 Virtual Threads 소개
debop
0
340
アーキテクチャモダナイゼーションとは何か
nwiizo
17
4.8k
Make GenAI Production-Ready with Kubernetes Patterns
bibryam
0
100
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
260
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
260
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
3
520
存在論的プログラミング: 時間と存在を記述する
koriym
5
860
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
3
260
Featured
See All Featured
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.3k
Embracing the Ebb and Flow
colly
88
5k
Amusing Abliteration
ianozsvald
1
150
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.5k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
150
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.5k
The Cult of Friendly URLs
andyhume
79
6.8k
Transcript
The Build Side of an Android App Nikita Kozlov Zalando
SE @Nikita_E_Kozlov Boris Farber Google @borisfarber
Background • Build improvement is the most requested feature from
developers • Worked with a few companies to speed up their builds • Share best practices and patterns
Problem • You add new features, libraries and frameworks. •
You refactor your code to smaller classes, add tests • Somehow, the build times add up
We don’t think about our build as a design component
Build challenge • Analysing build takes time • Difficult to
estimate and prioritize • Build improvement might be ambiguous
Focus on following • Build Tools versions • Hardware •
Modularization
Our process Create a test project Implement suggestion Test &
Measure Implement within a real project Android Studio Poet Gradle Profiler*
Incremental build change a Java/Kotlin file assembleDebug
Build Tools versions
Versions we tested • Gradle: 4.3.1 to 4.8 • Android
Gradle Plugin: from 3.0.1 to 3.1.2 • Kotlin: from 1.1.60 to 1.2.50
What about Build Tools versions? 2x speed up just from
the build tools
Another easy win From the build scan: • Compilation -
35% • Dexing - 55%
Dexing is a limiting step .CLASS .CLASS .CLASS .DEX .DEX
.DEX Will be faster if min SDK is 21 .CLASS
Incremental build with min SDK 21 Set min SDK to
21 during development to increase your build speed
Better Hardware
Hardware MacBook Pro 2015 • 13-inch • 2.7 GHz Intel
Core i5 • 16 GB 1867 MHz DDR3 MacBook Pro 2017 • 15-inch • 2,8 GHz Intel Core i7 • 16 GB 2133 MHz LPDDR3 vs
Hardware • Better hardware reduces build time significantly • Sometimes
even more than modularization
Background processes matters • Background processes reduces build time •
Antivirus made build speed 3 times slower
Modularization
Modularization - theory Module 2 Module 3 Module 1 App
Module App Module Key principles: 1. Parallelization 2. Caching 3. Compile avoidance
Compile Avoidance App Feature Incremental build after a change of
method’s body in Feature: 8s Incremental build after a adding a public method to Feature: 10s
Extracting rarely-changed code reduces build time App Incremental build with
a change in App: 55s Incremental build with a change in App: 39s App Utils
Work against tests whenever you can App Incremental build of
App with a change in App: 55s Incremental build of Utils module: 26s App Utils
Change in the library module vs application module App Utils
Incremental build of App module: 39s Incremental build of Utils module: 26s
Intermodule dependencies increase build time Incremental build with change in
Feature 3: 1m 5s Incremental build with change in Feature 3: 1m 11s Feature 1 Feature 3 Feature 2 App Feature 2 Feature 3 Feature 1 App
Start simple if you don’t have time App Tracking Utils
Core UI Networking App Feature Feature Feature Common code
Use a topology that works for you App App Monolith
Incremental build with change in App: 81s Incremental build with change in Main: 92s
Use a topology that works for you App Feature App
Monolith Feature Incremental build with change in Feature: 10s Incremental build with change in Feature: 7s
Modularization rules of thumb • Extract utils and other rarely-changed
code • Keep in mind the intermodule dependencies • Developing library modules in TDD way helps • Measure on a test project first
Our process Create a test project Implement suggestion Test &
Measure Implement within a real project Android Studio Poet Gradle Profiler
• Tool to generate large self contained Android projects •
https://github.com/android/android-studio-poet • Accepts JSON config file for the parameters Android Studio Poet
Features Java Butterknife Kotlin External Libraries Gradle Plugins Flavours Build
Types Intermodule dependencies Build Tools versioning String resources Images Layouts Activities Data Binding External repositories Dependency visualization Packages Classes Methods Fields
Two input formats Compact Full
Demo
Learn more • Extend Android Studio Poet - https://github.com/android/android-studio-poet/blob/master/exten d/Extending.md
• For this talk we made about 50 configs and more then 500 builds • Our configs, we used for this presentation https://github.com/android/android-studio-poet/tree/master/config s
Thanks ! And to Sergio Murguia, Google and Stefan Oehme,
Gradle
Questions ? Nikita Kozlov Zalando SE @Nikita_E_Kozlov Boris Farber Google
@borisfarber