They say that if the implementation of physics in the game is simple, then it is better not to connect the engine, but not to litter the project. For example, in the adroid studio I connect the AndEngine engine. And for example, used a couple of classes, it turns out when compiling into the apk as a result, all the classes of the library will fall? Even those that I have not used? Why the studio can not compile only used?
1 answer
By default, yes, all classes from all dependencies will be compiled and packaged in an apk file. Yes, some of them may not be used at all and still get into the final file.
To solve this problem, you can use proguard - it will remove all unused code and resources. Here is the link to the docks: tyk
Here are some more outdated, but a good example of setting up proguard for android: tyk
- Thank you, I just wanted to know that yes how. So far I at least write something, and then mess with size and performance. Another question is, is this a program that removes unused code, does it work exactly or does it approximately delete what is not needed? Will the code be cleaner if you manually use everything you need from the engine without connecting the engine? - Turalllb
- oneIt's easier to just take and connect the engine without even thinking about the size of the installation file because of it. It should remove exactly - there will be no excess. Disassemble engines are not worth it - why do you need it? - Yuriy SPb ♦
|