What are the rules for using strings.xml resource files versus an interface where String constants would be defined.
I'm assuming that the strings.xml resource file would be used to define non-functional strings to be used for display purposes such as text in various languages, date rendering formats, etc.
And Interface String constants would be used to define regular expression patterns, Intent extras variable name passing definitions, etc.
Correct. The key is that you can translate the strings in strings.xml - anything written in English (or any other language) and will be exposed to the user should be in strings.xml so you can translate it.
Patterns/regexes should be Strings for better performance, unless those regexes are language-specific.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With