0

All the drawable and raw files have 900kbs all together in my application, but the entire size of the application is comming ouut to be 5.5 Mbs. I am working in eclipse and google play services library along with appcompact_v7 library are attached.

How can i shrink the size of my exported apk file. Because my application is way too simple to have 5.5 Mbs.

Thankyou in advance.

Aleem Ahmed
  • 189
  • 1
  • 1
  • 11

3 Answers3

3

Use Android ProGuard tool. The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer.

Ashish Tamrakar
  • 810
  • 10
  • 24
2

First, consider switching to Android Studio and using a subset of Google Play Services, for whatever part you are using. The documentation has a "Selectively compiling APIs into your executable" section that covers this.

Second, if you are examining the size of your debug build, bear in mind that release builds use ProGuard to get rid of extraneous Java code, and so your releae APK will be a bit smaller.

Beyond that, Cyril Mottier has a great blog post on "Putting Your APKs on a Diet". However, some of the more powerful techniques, such as eliminating resources from Play Services via resConfigs, require Android Studio.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

There are some techniques you could achieve this:

You can read this Android official doc for more info : http://tools.android.com/tech-docs/new-build-system/resource-shrinking .

marius bardan
  • 4,962
  • 4
  • 29
  • 32