Should Android support libraries be compiled together in APK?

Asked

Viewed 171 times

4

I’m developing an application for Android, and it uses two libraries that Google provides.

To appcompat-v7 is used to have action bar on devices with version 2.3 or less, as this has only been added in version 3, and google-play-services to use Google Analytics services.

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

My question is whether this is really how it works or whether I should set up something so that these libraries are not compiled and are found in Runtime.

  • As far as I know, it has to be compiled. In fact, why do you need them for the application to work. "Found in Runtime"? And then how would you install apk on an Android?

1 answer

3


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

Something impractical for Android development and somewhat difficult even in desktop environments, since you have no way to ensure that the user’s JRE will contain the extensions you created.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.