I have previously posted a guide on how to extract string resources in Eclipse, so I thought I would do it for Android Studio too, as it is not directly obvious how to acheive this.

All your applications strings should be placed in the various /values/strings.xml files in your app. This is the best practice, gathers all texts, and easily enables you to translate your app into other languages.

While developing apps, it might be easier to just hardcode the string values, but when you are done testing, you can hit ALT + Enter to bring up the string resource extraction dialog.

Choose Extract string resource and type a name for the resource in the dialog.

Your string should now have been moved to the strings.xml file you selected (default is in: values/strings.xml).

The process goes like this:

Set the cursor inside the text you want to extract (here the text is the title “Cancel”) and hit ALT + Enter and select “Extracextract1](http://envyandroid.com/wp/wp-content/uploads/2014/03/extract1.png)

Give your resource a describing extract2](http://envyandroid.com/wp/wp-content/uploads/2014/03/extract2.png)

Your string has now been moved to the strings.xml file.

To view it, you can hold down cmd while clicking it (here “menu_cancel”) with the mouse, this will open the strinextract3](http://envyandroid.com/wp/wp-content/uploads/2014/03/extract3.png)

You can also extract string resources from your code, usiexamplecode](http://envyandroid.com/wp/wp-content/uploads/2014/03/examplecode.png)