How to reduce Android app size

Mayur Gade
2 min readJul 20, 2022

--

Large app size is always a concerning factor for developer. In this article I am going to share step by step guide on how to reduce the Android app size.

We all know that the maximum app size limit is 150 MB to upload on Play store. But we definitely not want to go edge to edge with this limit. The less app size, the less it will take space on end user device storage. If the application size is large, it will take longer time to download the app. So, it is always better to keep the app size as minimum as possible.

To analyze the app size, we can use one of best tools provided by Android Studio: App Analyzer. You can find this in Build -> Analyze APK. This shows detailed analysis of resources used in the app e.g. drawables, fonts, images, libraries etc. We can even compare APKs side by side.

Once we analyze the app, here are the steps to reduce the app size,

Reduce Android App Size
  1. Use ProGuard:
    ProGuard is like a “Bramhastra” on app size. It helps in code obfuscation, shrinking resources and keep unused code outside. Enabling “shrinkingResources” eliminates the resources that are not being used in the project. You will see a significant reduction in you app size after integrating ProGuard. You can read more about it from here - https://developer.android.com/studio/build/shrink-code
  2. Optimize images
    There are images which contributes to app size. Hi-res JPEG or PNG have much bigger sizes. The alternative to this is WebP format. It produces smaller file sizes compared to JPEG and PNG. You can also convert your existing images to WebP format by simply doing following steps:
    Step 1: Right click on an image and click “Convert to WebP”
    Step 2: Select lossy or lossless encoding and click “Ok”
    That’s it !!
  3. Use Vector graphics
    Vector graphics takes less file size as it uses mathematical calculations to represent a graphic. Another advantage of vector graphics is that we do not need to worry about screen densities.
  4. Reuse resources
    Try to reuse the resources wherever possible. Identify and remove possible duplicate resources.
  5. use debugImplementation
    Code of the libraries imported with debugImplementation is not available in release flavor code base.

This is all for this article. I hope this helps to reduce your app size.

Thanks for reading !!!

--

--