I have two related questions about using the appcompat libraries. For the sake of discussion, assume my min SDK level is 7, and my target SDK level is 19 (Kitkat). If my app is built with android-support-v4.jar:

  • Will that jar be retained when the app is installed on a device running Kitkat, or will it get jettisoned to reduce the app's size?
  • If a user installs multiple apps that contain android-support-v4.jar, is there some optimization that occurs to factor the duplicated jar out of all of the apps, or will there be one copy of the jar for each installed app?
有帮助吗?

解决方案

Will that jar be retained when the app is installed on a device running Kitkat, or will it get jettisoned to reduce the app's size?

It will be retained, to the extent the JAR even exists in your app.

If a user installs multiple apps that contain android-support-v4.jar, is there some optimization that occurs to factor the duplicated jar out of all of the apps, or will there be one copy of the jar for each installed app?

There will be one copy of the JAR for each installed app, to the extent the JAR even exists in your app.

Understand that in a production app, how much of the android-support-v4.jar will remain in your APK, after ProGuard gets through with it, will vary depending upon what features of that JAR you are using. One of the things that ProGuard does is remove unused classes, and those unused classes are mostly coming from JARs (at least, one hopes).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top