Nisha
Nisha

Reputation: 132

How to reduce size of apk file?

I am working on an application which is containing .apk file of 13.56MB. It is containing 70 .png images. And there is image transparency so it have to be in .png format. And i have to add more images. so do you have any solution to reduce the memory of an application.

Upvotes: 1

Views: 510

Answers (3)

Jaydip
Jaydip

Reputation: 686

Batter way to reduce size of apk. Split apk and minifyEnabled=true.

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt')
    }
}

splits {
    abi {
        enable true
        reset()
        include 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86'
        universalApk false
    }
}

Upvotes: 0

Jotiram Chavan
Jotiram Chavan

Reputation: 375

Use Following things

  1. use tiny png to reduce size of images without loosing quality https://tinypng.com
  2. Use tool AndroidUnusedResources to remove unneccessary resources https://code.google.com/p/android-unused-resources/
  3. Repackge jars or libraries using JarJar.jar tool. If you are using GooglePlayServices.jar then its too large

Upvotes: 0

Nikhil
Nikhil

Reputation: 16196

Please used 9-patch images.

Nine patch images are especially useful when designing buttons. Custom drawn buttons can look distorted and pixelated when their borders are stretched in addition to the rest of the image.

Official Documentation and other resource for further help.

Upvotes: 2

Related Questions