I have developed a simple Android application. Its APK size is 8MB. Can anyone tell me how to reduce the APK size?
Asked
Active
Viewed 2.4k times
3 Answers
10
- Try enabling ProGuard, even without obfuscation. It will remove unused Java code from your dependencies.
- See if you have unneeded dependencies - JARs that you've added but aren't using
- Check your resources for large images or other files. You may want to change their format or resolution, or remove them if they're not in use.
- Optimize your final APK (after ProGuard) with Facebook's ReDex. This should reduce the code size as well as potentially improve performance.

orip
- 73,323
- 21
- 116
- 148
8
1) First you need to enable Proguard even without obfuscation. It will remove unused Java code from your dependencies.
2) Second, use 9-patch images instead of very high resolution images.
3) Remove some unnecessary code and also JAR files that haven't be used.
4) Ensure you are using .png images instead of .jpg.
5) Use different images for different screen resolutions.
6) Check your layout folder for unnecessary XML files

Dan Dascalescu
- 143,271
- 52
- 317
- 404

Piyush
- 18,895
- 5
- 32
- 63
-
May I ask why should we use PNG instead JPG? I thought it was the other way around due to file size? – platypus Jan 01 '17 at 09:13