Reducing 50MB to 32MB

While developing our android app, we are often faced being close to the 50MB limit of the play store. To circumvent this problem we had multiple solutions:

1. using multiple `apk`

2. using `Proguard`

  • to shrink `class files`
  • to shrink `resources`

3. reorganize how we use `textures` in exercises

4. reduce `image file` sizes everywhere

Idea

  • Supplying only `HDPI` resources, till we can download more files if needed

Problem

  • If user has no internet, she only sees scaled images (potentially ugly)
  • Potentially introducing more complexity on user and developer side

Summary

  • Not pursued: adding complexity, by not addressing the real problem

Idea

  • Proguard can reduce size of `classes` and `resources`
  • Classes by removing classes not used
  • Resources by removing not used ones

Problem

  • Highly complex to configure/use
  • Not easily suitable for `classloading`, which we use. (Discoverable only at runtime…)
  • Resource shrinking only for non used resources, we use all of them.

Summary

  • Class reducing yield roughly 5–10 % for a non neglectable complexity overhead
  • Not pursued.

Idea

  • Currently different exercises use same/similar shapes, lets combine them

Problem

  • Complex and Error prune
  • Resulting atlases might be to big for memory,

Summary

  • Potential candidate for further investigation
  • Saving Capability very high though
  • Not pursued, due to time constraints

Idea

  • Optimize all images on file level
  • Shrink colour space to only needed colours, to be able to differentiate by the human
https://pngquant.org/
  • Further reduce images by find better compression codec
http://pmt.sourceforge.net/pngcrush/

Summary

  • Reduction from 50 MB to 32 MB
  • Thumbs up

Sample Script

We are always looking for talented developers, UI/UX designers and product managers, check out the latest openings here

We have recently spent 4 days developing 4 apps to help refugees during project #refugeeswelcome #hackweek15. More on the story here

Mario Bodemann
Android Developer Memorado