How can I find all hard coded strings in my project in Android Studio

Go to "Analyze > Run Inspection By Name...", and type "Hardcoded text". Run that one against your whole project, and you should get an inspection results panel that will show the hardcoded text instances.

You can also go to Android Studio > Preferences > Inspections > Hardcoded text and specify exactly how it runs, and what (if any) special cases are excluded from inspection.


For Windows platform, The best way I found is this:

You can use this shortcut Ctrl Alt Shift I and search for,

Hardcoded Text

in the search bar.

You can select appropriate module in which you want to search Hardcoded strings and it will give you the list of all Strings together.

Options for selecting modules


As @Maor Hadad and other upvotes suggested me : I convert my comment in an answer, so :

Since Android Studio 1.2.2, there is a new option in

"Analyse > Run inspection By Name" => "Hardcoded strings".

I used it and it seems quite more reliable with current version than "hardcoded text" (that checks only xml files).

Seen here link