I'd like to find any unused resources in my Android project - this includes strings, ids, drawables, integers etc.
Does a tool to do this currently exist (preferably for Eclipse)?
You can easily search for unused resources from Android Studio. Just press Ctrl Alt Shift i and type "unused resources" (without quotes). That will execute lint.
A friendly note: The IntelliJ idea ONLY works for resources that are not referenced in JAVA code. So if you have 1500 resources and only 20 are referenced directly from your java code, you end up with 1480 unused warnings in that file.
I'm seeing things marked as unused that I can clearly see are in use in various layouts. So keep that in mind ... don't go on a deleting spree.
Update to ADT 16 and use Android Lint. It is really amazing tool.
Android Lint is a new tool for ADT 16 (and Tools 16) which scans Android project sources for potential bugs.
Here are some examples of the types of errors that it looks for: - Missing translations (and unused translations) - Layout performance problems (all the issues the old layoutopt tool used to find, and more) - Unused resources - Inconsistent array sizes (when arrays are defined in multiple configurations) - Accessibility and internationalization problems (hardcoded strings, missing contentDescription, etc) - Icon problems (like missing densities, duplicate icons, wrong sizes, etc) - Usability problems (like not specifying an input type on a text field) - Manifest errors and many more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With