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
A journey to smaller APK size
Search
Dmytro Khmelenko
July 20, 2018
Programming
1
120
A journey to smaller APK size
Slides for the talk at 360|AnDev conference.
Dmytro Khmelenko
July 20, 2018
Tweet
Share
More Decks by Dmytro Khmelenko
See All by Dmytro Khmelenko
Securing Python Web Applications
dkhmelenko
0
20
Best of login experience
dkhmelenko
0
110
Best of sign in experience @ Droidcon Lisbon
dkhmelenko
0
80
Red or Green? Let us test
dkhmelenko
0
43
A journey to smaller apk size
dkhmelenko
0
60
How Git helps us with localization
dkhmelenko
0
97
Dagger.Android module
dkhmelenko
0
64
MVVM vs. MVP
dkhmelenko
0
47
Unit testing
dkhmelenko
0
39
Other Decks in Programming
See All in Programming
データの整合性を保つ非同期処理アーキテクチャパターン / Async Architecture Patterns
mokuo
45
16k
Amazon Bedrock Multi Agentsを試してきた
tm2
1
280
昭和の職場からアジャイルの世界へ
kumagoro95
1
360
DROBEの生成AI活用事例 with AWS
ippey
0
130
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
320
定理証明プラットフォーム lapisla.net
abap34
1
1.8k
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
2
310
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
150
Writing documentation can be fun with plugin system
okuramasafumi
0
120
社内フレームワークとその依存性解決 / in-house framework and its dependency management
vvakame
1
550
Introduction to kotlinx.rpc
arawn
0
670
ASP. NET CoreにおけるWebAPIの最新情報
tomokusaba
0
360
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
31
2.1k
The Invisible Side of Design
smashingmag
299
50k
We Have a Design System, Now What?
morganepeng
51
7.4k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Designing for humans not robots
tammielis
250
25k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
240
Practical Orchestrator
shlominoach
186
10k
Typedesign – Prime Four
hannesfritz
40
2.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Transcript
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