Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reduce Android APK size? [duplicate]

Tags:

android

I have developed a simple Android application. Its APK size is 8MB. Can anyone tell me how to reduce the APK size?

like image 688
Arunima Avatar asked Mar 08 '14 13:03

Arunima


People also ask

Can you compress APK?

You can compress an APK file (rar, zip), but it has to be decompressed in order to work. ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes. It optimizes bytecode and removes unused instructions.

Can * .APK be reverse engineered?

There might be separate config APKs for devices with larger screens, or different CPU architectures. For reverse engineering you usually just need the main APK, and you can ignore the rest.


1 Answers

  • 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.
like image 56
orip Avatar answered Sep 23 '22 01:09

orip