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
Putting Your APKs on Diet
Search
Brijesh Masrani
August 01, 2017
Technology
0
57
Putting Your APKs on Diet
Brijesh Masrani
August 01, 2017
Tweet
Share
More Decks by Brijesh Masrani
See All by Brijesh Masrani
Let's Stream that Video - an ExoPlayer Starters Guide
brijeshmasrani
0
160
Controlling APK Size When Using Native Library
brijeshmasrani
0
120
What's new in Android N
brijeshmasrani
1
220
Other Decks in Technology
See All in Technology
A2Aのクライアントを自作する
rynsuke
1
170
【TiDB GAME DAY 2025】Shadowverse: Worlds Beyond にみる TiDB 活用術
cygames
0
1.1k
Wasm元年
askua
0
140
AWS テクニカルサポートとエンドカスタマーの中間地点から見えるより良いサポートの活用方法
kazzpapa3
2
540
Node-RED × MCP 勉強会 vol.1
1ftseabass
PRO
0
140
BrainPadプログラミングコンテスト記念LT会2025_社内イベント&問題解説
brainpadpr
1
160
地図も、未来も、オープンに。 〜OSGeo.JPとFOSS4Gのご紹介〜
wata909
0
110
低レイヤを知りたいPHPerのためのCコンパイラ作成入門 完全版 / Building a C Compiler for PHPers Who Want to Dive into Low-Level Programming - Expanded
tomzoh
4
3.2k
急成長を支える基盤作り〜地道な改善からコツコツと〜 #cre_meetup
stefafafan
0
120
~宇宙最速~2025年AWS Summit レポート
satodesu
1
1.8k
CI/CD/IaC 久々に0から環境を作ったらこうなりました
kaz29
1
170
“社内”だけで完結していた私が、AWS Community Builder になるまで
nagisa53
1
390
Featured
See All Featured
Embracing the Ebb and Flow
colly
86
4.7k
Code Reviewing Like a Champion
maltzj
524
40k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
700
Transcript
Putting Your APKs on Diet - Brijesh Masrani (@brijeshmasrani)
What’s Inside APK?
APK Teardown 1. classes.dex 2. res 3. resources.arsc 4. AndroidManifest.xml
5. libs 6. assets 7. META-INF
classes.dex Contains compiled application code, transformed into Dex bytecode. •
Remove extra code. • Use Proguard ◦ It will try to strip any unused classes and class members, as well as rename any identifiers using shorter names. • Reuse whenever possible Rotate Images, Use Porterduff to change Color
Custom Proguard configs
Custom Proguard configs
res • WebP and SVG • Optimize png images •
Remove unused resources
libs • ndkFilters https://android.jlelse.eu/controlling-apk-size-when-using-native-libraries-45c6c0 e5b70a • ABI split
assets • Keep an eye on assets folder • font
files, json files, or game data Optimizations • Downloadable Fonts
External Libraries • Use only required libraries ◦ Google Play
Services, Analytics, Maps, Awareness, FCM
• Be opinionated about resources hdpi, xhdpi and xxhdpi OR
xxhdpi • minifyEnabled true • shrinkResources true • defaultConfig { ... resConfigs "en", ... } Gradle Changes
General Tips • Use APK analyser
References • https://android.jlelse.eu/controlling-apk-size-when-using-native-libraries-45c 6c0e5b70a • https://medium.com/google-developers/smallerapk-part-1-anatomy-of-an-a pk-da83c25e7003 • https://medium.com/google-developers/smallerapk-part-3-removing-unuse d-resources-1511f9e3f761
• https://www.youtube.com/watch?v=xctGIB81D2w • https://www.youtube.com/watch?v=AdfKNgyT438&t=3