To keep things efficient, I share a code module among my projects that contains a bunch of often-used sub routines.
However, some of these routines require the JavaObject lib, and others require the Phone lib, etc.
My understanding is that if I have a subroutine that uses a library, even if my app doesn't actually call that routine, the compiler will still include that routine and it's associated lib into the APK, making it bigger then it needs to be. Is this a correct understanding?
Going on the assumption that I do understand this correctly, I want to keep the APK size down. So I started using conditional symbols like USESJO (uses javaobject) and USESPHONE, etc so it won't include routines that need certain external libraries if I don't need them. For example, if I don't need any routines that use the JO, I won't use the USEJO symbol so the compiler wont include those routines or the JO lib itself in the APK.
But this is starting to get complex because some routine need both JO and PHONE, etc. Yeah, I could break things up into separate code modules, but that will get messy too.
So, before I spend anymore time trying to optimize this further, is there a way to find out how much bigger the APK will get if I include a particular lib, like the JavaObject lib?
This way, if I can find libs that are very small and won't effect the APK size significantly, I wont worry about trying to optimize them and just keep the routines that use these small libs enabled all the time and not waste time with extra conditional symbols.
Also, I understand that simply knowing the lib size might only be half the story because certain libs could require the compiler to include other libs, such as an android support lib, which could be much bigger then the original lib. So, in this case, is there a way to trace what libs invoke the biggest changes to an APK's size?
However, some of these routines require the JavaObject lib, and others require the Phone lib, etc.
My understanding is that if I have a subroutine that uses a library, even if my app doesn't actually call that routine, the compiler will still include that routine and it's associated lib into the APK, making it bigger then it needs to be. Is this a correct understanding?
Going on the assumption that I do understand this correctly, I want to keep the APK size down. So I started using conditional symbols like USESJO (uses javaobject) and USESPHONE, etc so it won't include routines that need certain external libraries if I don't need them. For example, if I don't need any routines that use the JO, I won't use the USEJO symbol so the compiler wont include those routines or the JO lib itself in the APK.
But this is starting to get complex because some routine need both JO and PHONE, etc. Yeah, I could break things up into separate code modules, but that will get messy too.
So, before I spend anymore time trying to optimize this further, is there a way to find out how much bigger the APK will get if I include a particular lib, like the JavaObject lib?
This way, if I can find libs that are very small and won't effect the APK size significantly, I wont worry about trying to optimize them and just keep the routines that use these small libs enabled all the time and not waste time with extra conditional symbols.
Also, I understand that simply knowing the lib size might only be half the story because certain libs could require the compiler to include other libs, such as an android support lib, which could be much bigger then the original lib. So, in this case, is there a way to trace what libs invoke the biggest changes to an APK's size?