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
65
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Putting Your APKs on Diet
Brijesh Masrani
August 01, 2017
More Decks by Brijesh Masrani
See All by Brijesh Masrani
Let's Stream that Video - an ExoPlayer Starters Guide
brijeshmasrani
0
200
Controlling APK Size When Using Native Library
brijeshmasrani
0
150
What's new in Android N
brijeshmasrani
1
220
Other Decks in Technology
See All in Technology
トヨタ⽣産⽅式(TPS)⼊⾨
recruitengineers
PRO
3
1.1k
Kiro Crew入門 - 常駐エージェントの仕組みと使いどころ / Intro to Kiro Crew
k_adachi_01
1
580
AI・HPC開発を支えるGPU環境の新しい選択肢 液冷GPUシステム「AquSys」の取り組み
gpuunite_official
0
130
Go 1.27 の標準パッケージに uuid が入った!のでいろいろ喋る / go_127_std_go_uuid
convto
3
530
Agent 時代の Kaggle 展望 / kaggle-in-the-agentic-era
upura
1
850
生成 AI の基礎 〜 サンプル実装で学ぶ基本原理
enakai00
7
4.4k
Genie Codeハンズオン応用編
taka_aki
0
130
平文パスワードはログに“残り” ── 肝心の侵入は“痕跡すら残らない”
kuroneko13
0
110
Oracle MCP Servers Explained
thatjeffsmith
0
180
AIにブラウザを触らせて、E2EテストをPlaywrightで書く
koji_kawamura
0
160
強化学習「理論」入門
enakai00
3
3.6k
35分でわかるEffective Platform Engineering
nwiizo
5
510
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.7k
Documentation Writing (for coders)
carmenintech
77
5.5k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
280
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Abbi's Birthday
coloredviolet
3
9.4k
Facilitating Awesome Meetings
lara
57
7.1k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
550
Designing for humans not robots
tammielis
254
26k
Writing Fast Ruby
sferik
630
63k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
250
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
800
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
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