Android Studio: Difference in size between Build APK vs Run APK

后端 未结 4 1866
我寻月下人不归
我寻月下人不归 2021-01-11 23:27

I have noticed a difference in size between the apk generated with these 2 options.

why is this happening ?

With the Build -> Build APK opti

4条回答
  •  一整个雨季
    2021-01-12 00:10

    When you create the build by Build->Build APK, the apk will contain all the resources for all the devices. i.e for ldpi, mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi.

    But in case you are running the app on device/emulator, it will detect that what the resolution of the phone is and will add only the resources with that resolution into the apk file. For ex, if your device is xhdpi , it will drop all other screen resolutions and will contain only xhdpi resources.

提交回复
热议问题