Vs library direct code in android

Direct coding with library

Will use a library with the same code and functionality, increasing the size of the application compared to the case when the code is written directly instead of calling the library

For example, consider code for longitude and latitude. If I put it in a library and attach this library to the project and call the methods present in it to get the values ​​instead of writing the code directly, this will add the size of the application. If this does not change the size, then it would be useful to create such libraries and, if necessary, attach them to projects

early

+4
source share
2 answers

I understand that if you use Proguard in accordance with the recommendations of Google, theoretically they should be an APK of the same size. Proguard should only use classes from the libraries referenced to build the APK.

In addition, Proguard has other functionality to reduce the size of the APK. However, this does not deprive him of his shortcomings.

http://developer.android.com/tools/help/proguard.html

Note. Proguard is used only after you are ready for production.

+4
source

Although this question needs additional development, and such a comparison will not give you a 100% answer, usually using libraries will give you a smaller application size.

A clean C library without OOP should give the best results.

0
source

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


All Articles