Reduce android size

I have a problem with the size of the application in android.

Scenario:

I developed an Android app in Android Studio 2.0 and the apk size was 23 MB.

After that, I updated my IDE to version 2.2 for Android and with a slight modification of the code, the apk size increased to 51 MB.

I tried with the Vice Rector and Lint, but had no advantage.

Can someone help me solve this problem.

+4
source share
2 answers

1) Replace all images, icons with a vector pattern

2) Turn on the pro guard as shown below. Goto build.gradleapp level

and put these lines

** shrinkResources true

minifyEnabled true **

3) , drawable LINT,

JAVA

4) android studio 2.2 apk analyzer . APk

5), 100mb, split apk. apk ABI Density Splits

+2

build.gradle(Module:app). apk (40-50)%.

android {
// Other settings

  buildTypes {
      release {
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
      }
  }
}

classes.dex res folder.

webp BMP, JPG, PNG .

: https://developer.android.com/studio/write/convert-webp.html

apk :

https://developer.android.com/topic/performance/reduce-apk-size.html

https://medium.com/how-you-can-decrease-application-size

0

Source: https://habr.com/ru/post/1658321/


All Articles