Should Android support libraries be compiled together in APK?

4

I'm developing an Android app, which uses two libraries that Google makes available.

appcompat-v7 is used to have action bar on devices with version 2.3 or lower, since it was only added in version 3, and google-play-services to use Google Analytics services.

The point is that after I added these libraries, the final APK size jumped from 160Kb to two 2Mb. This happened because the files from these two libraries were compiled together with the APK.

My question is whether this is how it works, or whether I should configure something so that these libraries are not compiled and found in runtime.     

asked by anonymous 22.04.2014 / 05:31

1 answer

3

They have to be compiled. The only solution I know to avoid this is through extensions to the Java runtime environment, as this link explains better.

Something impractical for Android development and a bit of a hassle even in a desktop environment, since you can not guarantee that the user's JRE will contain the extensions you've created.

    
22.04.2014 / 16:49