Do I really need to put every string into strings.xml?
android
Solution
You do not have to write the strings in the xml. It is optional and it is possible to disable those warnings.
But it is a good practice:
- If one day you want to translate to another language or internationalize, you will have all the strings in same place.
- If a string is used in more than one place and you want to change it, it's easier to change it once in the xml than to edit all the places you use it.
Problem
I'm tired of getting messages from my IDE about putting another hardcoded string into XML file. I don't understand why should I put it there and make my strings.xml grow large because of every hardcoded string which I definitely won't use again or in another place. Is there any reason why should better keep all strings in XML?