Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I need to find and extract all hard coded strings in my project in Android Studio (beta) 0.84. I need a static analysis tool like Find Bugs do this for me in one shot and allow me to step through each message and extract the string to resource files. Even better would be if the entire process is automated.

In Android Studio (beta) 0.84 the File / Setting /FindBugs-IDEA shows I18N as an option under Reporting tab. But I just cannot figure out how to make it work.

Thanks for any suggestions.

like image 795
Farrukh Najmi Avatar asked Jul 30 '14 18:07

Farrukh Najmi


People also ask

What is hard coded string?

Hardcoded string are the literal strings. So, What you may be referring to is, literal strings in the data. C# Copy Code.


1 Answers

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

like image 177
PAD Avatar answered Sep 25 '22 15:09

PAD