Skip to content

IntelliJ/Android Studio plugin for tracking and visualizing Android resource usage, helping developers maintain cleaner codebases and make informed refactoring decisions.

Notifications You must be signed in to change notification settings

dmitrish/android-resource-usage-tracker

Repository files navigation

Android Resource Usage Tracker

Build Version Downloads

Track and visualize Android resource usage across your entire project with intuitive gutter icons and interactive popups.

Features:

  • Visual Usage Counters - See at a glance how many times each resource is used with color-coded gutter icons
  • Interactive Click Navigation - Click any usage counter to see all usages with code snippets and navigate directly to them
  • Cross-Module Search - Finds usages across all modules in multi-module projects
  • AndroidManifest.xml Detection - Detects theme and style references in manifest files
  • Smart Deduplication - Uses PSI tree hashing to avoid duplicate results
  • Performance Optimized - Word-based indexing for fast searches even in large projects
  • Supports All Resource Types - Strings, colors, dimensions, styles, drawables, and more

Perfect for:

  • Identifying unused resources for cleanup
  • Understanding resource dependencies
  • Refactoring with confidence
  • Code reviews and audits

Demo

Android Resource Usage Tracker in Action

Visual usage counters with color-coded badges: 🔴 Red (unused), 🟢 Green (1-4 uses), 🟠 Orange (5+ uses)

🚀 Get Started

Install from JetBrains Marketplace

Quick Install: Settings/PreferencesPluginsMarketplace → Search "Android Resource Usage Tracker"

Usage

  1. Open any Android resource file (e.g., res/values/strings.xml, res/values/colors.xml)
  2. Look for colored badges in the gutter next to each resource definition
  3. Click on any badge to see:
  • All usages across your project
  • Code snippets showing context
  • File paths and line numbers
  1. Double-click any usage to navigate directly to that location

Understanding the Badge Colors:

Color Usage Count Meaning Action
🔴 Red 0 Unused resource Safe to delete - consider cleanup
🟢 Green 1-4 Normal usage Standard resource, well-scoped
🟠 Orange 5+ Heavily used Core resource, refactor carefully

Supported Resource Types

  • Strings (<string>)
  • Colors (<color>)
  • Dimensions (<dimen>)
  • Styles and Themes (<style>)
  • Drawables (<drawable>)
  • Integers (<integer>)
  • Booleans (<bool>)
  • Arrays (<array>, <string-array>, <integer-array>)
  • Plurals (<plurals>)
  • IDs (<id>)

Requirements

  • Android Studio Ladybug (2025.2.1) or newer
  • IntelliJ IDEA 2025.2 or newer with Android plugin

Installation

  • Using IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for "Android Resource Usage Tracker" > Install

  • Using JetBrains Marketplace:

    Go to JetBrains Marketplace and install it by clicking the Install to ... button in case your IDE is running.

    You can also download the latest release from JetBrains Marketplace and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...

  • Manually:

    Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...

Known Limitations

  • Does not track resources used via reflection or dynamic resource loading
  • Generated files (R.java, BuildConfig) are excluded from usage counts
  • First-time indexing may take a moment in very large projects

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have feature requests, please open an issue on GitHub.


Plugin based on the IntelliJ Platform Plugin Template.

About

IntelliJ/Android Studio plugin for tracking and visualizing Android resource usage, helping developers maintain cleaner codebases and make informed refactoring decisions.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages