Reputation: 713
I have an Android App named A. I create a new copy B with the same functionality but different package name. The difference between both the apps will be usage of different AD Network.
I divide my Code into different libraries and upload them to online repository, so that I can simply change the code in both the app by simply changing a single line in both the apps Gradel file.
Instead of manually changing the code for both the apps.
For Eg-
A has three features X,Y,Z
B has two features X,Y.
Now if there is some issue in X feature I will have to change the code for X in both A and B but if I plan to divide them into library I will have to change the code only once and update the A and B apps with the new libraries.
But will using this kind of setup will it increase the size of the app, OR will it be the same as if I use the code manually.
EDIT: Is there any other dis-advantage for adding code as library?
Upvotes: 1
Views: 143
Reputation: 1936
Hard to tell,but yes in general adding libraries to app increase the size of the app ofcourse, but in your case it's definitly a good apraoch in favour of code refactoring, and i don't see any inconveniences of using a library
Upvotes: 1