-1

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?

Alon Aviram
  • 190
  • 1
  • 15

2 Answers2

0

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.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
0

Even if your app will never be localised, it's a convention to follow.

Code is place where you spend almost half your day. So you should keep it as neat and managed as you can.

And your code will only use one string if that is being used multiple times. So no duplicates. and thus reduced string memory in java.

Khemraj Sharma
  • 57,232
  • 27
  • 203
  • 212