Hey Lint, help me getting out of this hardcoded strings hell
That moment when you start working on a legacy project, the customer asks you to check why the app is not translated correctly and you find the source code full of hardcoded strings, hundreds of hand written string constants.
You already see yourself trapped into the hell of reviewing all classes and layouts in the project to fix that mess.
In this weird situation lint tool can come in handy.
Lint is a code analysis tool that checks your Android project source files for potential bugs, optimization improvements, correctness, security, performance, usability, accessibility, and internationalization.
The latter is what we need it for this time.
You can run lint both from command line and inside Android Studio.
To run lint inside Android Studio just go to the Analyze menu and select Inspect code… select your scope (e.g. Workspace) then click Ok.
It’ll run for a while (depending on your project complexity and your machine) and generate a report (can be exported in HTML or XML) grouped by inspection type, as follows: