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
100
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
Best of login experience
dkhmelenko
0
110
Best of sign in experience @ Droidcon Lisbon
dkhmelenko
0
60
Red or Green? Let us test
dkhmelenko
0
39
A journey to smaller apk size
dkhmelenko
0
54
How Git helps us with localization
dkhmelenko
0
93
Dagger.Android module
dkhmelenko
0
49
MVVM vs. MVP
dkhmelenko
0
42
Unit testing
dkhmelenko
0
32
RxJava at Freeletics
dkhmelenko
0
76
Other Decks in Programming
See All in Programming
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
130
ゆるい個人開発のススメ
kuroppe1819
10
990
Anthropic Cookbook のおすすめレシピ
schroneko
7
980
GitHub Copilotのススメ
marcy731
1
200
Amazon SQSコンシューマー疎結合への旅 - 出張! #DevelopersIO IT技術ブログの中の人が語る勉強会 #3
quiver
0
270
What We Can Learn From OSS
inouehi
0
420
2 週間で Twitter Bot を作ってみた
contour_gara
0
510
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
220
Milestoner
bkuhlmann
1
410
Hanami and htmx
bkuhlmann
0
210
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
110
Git Lint
bkuhlmann
4
750
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
50
9.2k
Debugging Ruby Performance
tmm1
70
11k
10 Git Anti Patterns You Should be Aware of
lemiorhan
648
58k
Infographics Made Easy
chrislema
238
18k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
357
22k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
40
4.4k
A Philosophy of Restraint
colly
197
16k
Raft: Consensus for Rubyists
vanstee
132
6.3k
Teambox: Starting and Learning
jrom
128
8.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
20
1.9k
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