Search code examples
androidcode-standards

should i use strings.xml for readability in the long run?


mainly concerned about code readability & maintainability in the long run, my application will never be localized and little to none strings duplication

textView.setText(context.getString(R.string.string, arg));

in comparison to:

textView.setText(String.format("string %s", arg));

what do you think?


Solution

  • Yes. You should keep all strings in resource file. Readability is no excuse here, as Android Studio will show you the value of referenced resource so this makes no real problem.