Useful Inspections in Android Studio – Part 1

A code inspection is a way by which your IDE (Android Studio) can analyse your entire project code for some specific issues and suggest you the appropriate improvements.

There are many inspections which can help save lot of your development time. Here we discuss few of them.

I will update this article to include more inspections as i find new inspections. Right now i list out the ones i found useful.

1. Hard-coded Strings Inspection

In the android development it is considered a good practice to move all of your strings in the Strings.xml resource file. This helps you to reuse your strings and save your time in typing repeat messages at the various places.

It is very trivial that you may forget to transfer your strings to the strings.xml file. In this situation you might be worried/concerned about how to find all the hard-coded strings in your project and transfer them to the strings.xml file. Let us see the instructions !!!

Go to Android Studio and navigate to

Analyze > Run inspection by name 
and Type "Hardcoded strings".

This inspection helps the users discover all the hardcoded strings in your project and you can now move those hardcoded strings to the Strings.xml file.

Leave a Reply

Your email address will not be published. Required fields are marked *