4

I got a question about project library and size of an Android application.

Let me explain:

I have a library project, let's call it A that is used in 3 library projects (B, C and D).

In my Android Application, I have 3 library dependencies (1 for B, 1 for C and 1 for D).

So in fact it looks like this:

application's architecture

Then my question is:

Is the A library project 3 times in my application ? Or just used 1 time for every block that use it (B, C, D, even My Application).

In other words, if the size of A is 1MB, does My application is 1MB bigger or 3MB bigger ? (not exactly but the point is there)

halfer
  • 19,824
  • 17
  • 99
  • 186
Quentin Klein
  • 1,263
  • 10
  • 27
  • Maybe this link can help http://stackoverflow.com/questions/14287321/how-to-include-external-libraries-in-multiple-projects-without-making-multiple-c?rq=1 – vdolez Sep 19 '14 at 08:19

1 Answers1

1

The A library is only copied once in your application, and the components and other libraries of your application use it without re-downloading it or copying it. If you check Maven's POM file for example, you will see that: If you have two libraries A and B, and library A is dependent on library C and D and library B is dependent on C and E, the Maven will see that the library C is already downloaded and included to your project and will not re-download it or copy it whatsoever. Same thing applies to other project management tools from what I know.

Plus when you include more than one times a duplicate code you might see errors such as: Multiple dex files define ...

Conclusion: Library A is "only included 1 time in your application".

George Daramouskas
  • 3,720
  • 3
  • 22
  • 51