Hey,

In the guide below, I see that string resources are being used as keys for 
getting and setting shared preferences:
http://developer.android.com/training/basics/data-storage/shared-preferences.html

However, since the keys are not going to be presented in any way to the UI, 
and I wouldn't want them to change if the user changed the locale, I see no 
reason to store them as string resources. I think that using constant class 
is a better solution in this case.
This stackoverflow thread reinforces my position:
http://stackoverflow.com/questions/25428064/where-to-store-string-valuesin-strings-xml-or-in-constants-class

Do you have any reason why I would want the shared preferences key to be a 
resource string?

Thank you,
Haim Litvak.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/3578e5e1-d5b9-44a8-a527-41db6589c378%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to