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
110
What's new in Android N
brijeshmasrani
1
220
Other Decks in Technology
See All in Technology
20250514_未経験から Fintech実務参画まで。学生エンジニアの挑戦録
hideto1008
0
900
やさしい認証認可
minorun365
PRO
29
11k
dbt Cloudの新機能を紹介!データエンジニアリングの民主化:GUIで操作、SQLで管理する新時代のdbt Cloud
sagara
0
160
Agent Development Kit によるエージェント開発入門
enakai00
19
2.8k
おれのAI活用の現状とこれから
tsukasagr
0
130
上長や社内ステークホルダーに対する解像度を上げて、より良い補完関係を築く方法 / How-to-increase-resolution-and-build-better-complementary-relationships-with-your-bosses-and-internal-stakeholders
madoxten
13
6.5k
New Cache Hierarchy for Container Images and OCI Artifacts in Kubernetes Clusters using Containerd / KubeCon + CloudNativeCon Japan
pfn
PRO
0
130
Tenstorrent 開発者プログラム
tenstorrent_japan
0
270
Kubernetesで作るAIプラットフォーム
oracle4engineer
PRO
2
220
Introduction to Bill One Development Engineer
sansan33
PRO
0
250
從開發到架構設計的可觀測性實踐
philipz
0
210
Test Smarter, Not Harder: Achieving Confidence in Complex Distributed Systems
eliasnogueira
1
140
Featured
See All Featured
Balancing Empowerment & Direction
lara
1
190
Git: the NoSQL Database
bkeepers
PRO
430
65k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Embracing the Ebb and Flow
colly
85
4.7k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
32
5.9k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
870
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Scaling GitHub
holman
459
140k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Done Done
chrislema
184
16k
Unsuck your backbone
ammeep
671
58k
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