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

Optimise your APK Size

Optimise your APK Size

A recent study by Google found that the average app size has quintupled since the play store was launched in 2012. As app developers, we continue to add more features, more SDK’s, higher resolution graphics, pushing the envelope of APK size even higher. But how does the increase in APK size, impact App installs? The same Google study also revealed that about 75% of people consider the size of APK before downloading.

This talk goes through the steps you can use to reduce your APK size and how at Viki, we reduced our app size by 50%

Saurabh

June 19, 2018
Tweet

More Decks by Saurabh

Other Decks in Programming

Transcript

  1. Rakuten Viki • Video Streaming • Korean and Asian TV

    Shows • Global TV powered by Fans
  2. Small is Better. Why? • How much data to download

    • Time taken to download and install • Internet connectivity issues
  3. Remove Unused Resources • Does not remove assets • Does

    not remove resources inside “values” folder.
  4. Dependencies - Kotlin and Moshi • Kotlin-reflect jar - 2.5Mb

    • Use Codegen • Annotate model objects with @JsonClass(generateAdapter = true)
  5. Dependencies - Lottie • Use instead of GIF and PNG

    sequences • Json’s are smaller • Multiple ways to generate the same animation • Follow their guidelines to generate optimized JSON’s
  6. Total Savings Raw File Size => 14.8 MB to 10.4

    MB = -4.4 MB Download Size => 10.7 MB to 6.5 MB = -4.2 MB Original Final
  7. Split APK’s • Build multiple APK’s • Target by screen

    density • Target by binary/CPU architecture
  8. Split APK’s Android App Bundle • Build multiple APK’s •

    Target by screen density • Target by binary/CPU architecture
  9. Android App Bundle • Announced at IO 18 • Google

    does the job of split apk’s • Enroll for Google Play Signing
  10. Summary • On Viki, APK size reduced by 50% •

    Saw growth in emerging markets after that • Helped with instant app and Android Go • Tip: Hook up your CI to detect size changes • And remember lesser is always better