As I had some trouble to find out whether a resource is used or not, I created a tool with my low level python skills.

The “Android Resource Tracker” reads the content of the generated R.java file to find all given resources (so not only the drawables).
Then it checks if you use them in your Android code or in one of the XML files.

Requirements:
Python v2.6.5 or better (tested with Python 2.6.5 and Python 3.1.2)

Short “License”:

Feel free to modify and/or enhance this tool. Also feel free to fix bugs you found.
I would be happy if you could share your modified version on the blog where this tool
was posted.

Blog-URL: http://www.droidnova.com/android-resource-tracker,723.html

This tool is from a developer for developers, so be a good colleague and share your
improvements of this tool with the others.

EXPLICITLY: No license… I trust your good will… if you get rich, share with me :)

Created on 24.09.2010

@version: 1.0
@author: Martin Breuer (aka WarrenFaith)

Usage:

This is a tool that help you to find out, if a resource is used.
Parameter:
-h : shows this help
-i : root directory of your android project
-v : show all matches
–unused-only : shows only unused elements – does not work with –used-only
–used-only : shows on used elements – does not work with –unused-only

If you have improvements, new features or bug fixed, please share them with me, I will update the tool for you!

Project page: Android Resource Tracker

Share