Reputation: 7114
I know this is a very unusual question but bear with me.
I have been handed a project that was developed by someone very new to Android. The project has 135 Java files. A lot of them are not getting used in the app I'm sure of that.
What I want to know is, is there any way to check which files are being used without testing every function of the app a hundred times?
Upvotes: 0
Views: 444
Reputation: 5326
This is not the solution but a good trick to mantain your code clean and indented:
In order to clean the import section, importing just what you actually use, press:
for mac
CMD + SHIFT + O
or for windows
CTRL + SHIFT + O
In order to indent your code and your layout, press:
for mac
CMD + SHIFT + F
or for windows
CTRL + SHIFT + F
I repeat it, this is not the solution of your problem, but it can help a lot!
Upvotes: 0
Reputation: 39797
Build your code and include ProGuard in the build steps; ProGuard will discard unused classes / methods (except those which it has been configured to retain, such as the ones Android is likely to need retained). The examine ProGuard's logged output to see what it did, and manually remove those methods / classes.
Upvotes: 3