Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
A journey to smaller APK size
Search
Dmytro Khmelenko
July 20, 2018
Programming
130
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
A journey to smaller APK size
Slides for the talk at 360|AnDev conference.
Dmytro Khmelenko
July 20, 2018
Transcript
37 slides
A JOURNEY TO SMALLER APK SIZE Dmytro Khmelenko Software Engineer
19-20 July 2018
ONCE UPON A TIME… Release APK size is 63 MB
2
ONCE UPON A TIME… Release APK size is 63 MB
3
Analysis 4 EPISODE 1
5 ANALYZE APK
ANALYZE APK 6
The developers strike back 7 EPISODE 2
RESOURCES OPTIMIZATION 8 ✅ Shrink video files (- 10 MB)
9 Overall bit rate : 3 235 kb/s Bits/(Pixel*Frame) :
0.549 Stream size : 4.77 MiB (94%) File size : 5.3 MB Overall bit rate : 735 kb/s Bits/(Pixel*Frame) : 0.108 Stream size : 963 KiB (81%) File size: : 1.2 MB
RESOURCES OPTIMIZATION 10 ✅ Shrink video files (- 10 MB)
✅ Shrink audio files (- 4 MB)
AUDIO FILES 11 Before: Bit rate : 256 kb/s Channel(s)
: 2 channels Sampling rate : 44.1 kHz File size : 56.4 KB After: Bit rate : 32.0 kb/s Channel(s) : 1 channel Sampling rate : 16.0 kHz File size : 13.7 KB
RESOURCES OPTIMIZATION ✅ Shrink video files (- 10 MB) ✅
Shrink audio files (- 4 MB) ✅ Shrink and optimize drawables (- 25 MB) 12
13 525 KB, .png 75 KB, .jpg
DRAWABLES OPTIMIZATION ✅ Remove unused drawables (Lint, ProGuard) ✅ Support
only hdpi, xhdpi and xxhdpi ✅ Use .jpeg, when possible ✅ Use .webp instead of .png 14
DRAWABLES SIZE hdpi ~ 50 KB xhdpi ~ 100 KB
xxhdpi ~ 150 KB 15
Review 16 EPISODE 3
TIME TO REVIEW 17
TIME TO REVIEW 18
LEARNINGS Pay attention to resources Collaborate with designers 19
A new hope 20 EPISODE 4
FURTHER STEPS • Multiple APK split by screen density •
Multiple APK split by CPU architecture • Automatically check size for every new file 21
22
APP BUNDLE 23 { "supportedAbis": ["x86_64", "x86", "armeabi-v7a"], "supportedLocales": ["en-US",
"de-DE"], "screenDensity": 320, "sdkVersion": 24 }
APP BUNDLE 24 hdpi base-en.apk: 52 KB base-master.apk: 12.5 MB
base-hdpi.apk: 2.3 MB
APP BUNDLE 25 base-master.apk
APP BUNDLE 26 base-hdpi.apk
APP BUNDLE 27 hdpi base-en.apk: 52 KB base-master.apk: 12.5 MB
base-hdpi.apk: 2.3 MB xxhdpi base-en.apk: 52KB base-master.apk: 12.5 MB base-xxhdpi.apk: 6.3 MB xhdpi base-en.apk: 52 KB base-master.apk: 12.5 MB base-xhdpi.apk: 3.4 MB
APP BUNDLE 28 hdpi base-en.apk: 52 KB base-master.apk: 12.5 MB
base-hdpi.apk: 2.3 MB xxhdpi base-en.apk: 52KB base-master.apk: 12.5 MB base-xxhdpi.apk: 6.3 MB xhdpi base-en.apk: 52 KB base-master.apk: 12.5 MB base-xhdpi.apk: 3.4 MB
APP BUNDLE 29 hdpi base-en.apk: 52 KB base-master.apk: 12.5 MB
base-hdpi.apk: 2.3 MB xxhdpi base-en.apk: 52KB base-master.apk: 12.5 MB base-xxhdpi.apk: 6.3 MB xhdpi base-en.apk: 52 KB base-master.apk: 12.5 MB base-xhdpi.apk: 3.4 MB 14.9 MB 16.0 MB 18.9 MB
Random data 30 EPISODE 5
31 REGISTRATIONS
The phantom menace 32 EPISODE 6
MEANWHILE 33
WE NEED TO STOP IT 34 bit.ly/2NvSafl
IT WORKS 35
RESOURCES • https://developer.android.com/topic/performance/reduce-apk-size.html • https://developer.android.com/guide/app-bundle • https://medium.com/@d.khmelenko/a-journey-to-a-smaller-apk-78155416f280 • https://medium.com/@d.khmelenko/android-app-bundle-6fd1e55c4c4b 36
THANK YOU! @dkhmelenko
More Decks by Dmytro Khmelenko
See All by Dmytro Khmelenko
Securing High-Risk Django Applications
dkhmelenko
0
12
Securing High-Risk Django Applications: Lessons from the Payment Domain
dkhmelenko
0
95
Securing Python Web Applications
dkhmelenko
0
46
Best of login experience
dkhmelenko
0
130
Best of sign in experience @ Droidcon Lisbon
dkhmelenko
0
140
Red or Green? Let us test
dkhmelenko
0
53
A journey to smaller apk size
dkhmelenko
0
80
How Git helps us with localization
dkhmelenko
0
110
Dagger.Android module
dkhmelenko
0
84
Other Decks in Programming
See All in Programming
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
240
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
640
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
250
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
1k
SODA - FACT BOOK(JP)
sodainc
1
40k
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.4k
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
2.7k
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
200
止まらない比較を止める — 余帰納法で無限ストリームを比べる
tarao
0
210
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
370
Distance field of Julia set
kinakomoti321
0
330
Featured
See All Featured
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
Become a Pro
speakerdeck
PRO
31
6.4k
Six Lessons from altMBA
skipperchong
29
4.6k
Thoughts on Productivity
jonyablonski
76
5.5k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
620
Typedesign – Prime Four
hannesfritz
42
3.2k
A Modern Web Designer's Workflow
chriscoyier
699
190k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
The untapped power of vector embeddings
frankvandijk
2
2k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
840
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k