Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A journey to smaller APK size

A journey to smaller APK size

Slides for the talk at 360|AnDev conference.

Dmytro Khmelenko

July 20, 2018
Tweet

More Decks by Dmytro Khmelenko

Other Decks in Programming

Transcript

  1. 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
  2. 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
  3. RESOURCES OPTIMIZATION ✅ Shrink video files (- 10 MB) ✅

    Shrink audio files (- 4 MB) ✅ Shrink and optimize drawables (- 25 MB) 12
  4. DRAWABLES OPTIMIZATION ✅ Remove unused drawables (Lint, ProGuard) ✅ Support

    only hdpi, xhdpi and xxhdpi ✅ Use .jpeg, when possible ✅ Use .webp instead of .png 14
  5. FURTHER STEPS • Multiple APK split by screen density •

    Multiple APK split by CPU architecture • Automatically check size for every new file 21
  6. 22

  7. 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
  8. 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
  9. 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