What's the best way to refer to Android resource IDs from a SQLite
database?

For instance if I have a "category" table with cols id, and
category_name.  Right now I store a default English name in
category_name, but I'd also like to be able to localize that when I
display it in the UI.

The one approach I've considered is to use the category_name col to
store a string representation of the Android resource name (e.g.
category_name_fine_dining), then use getResources().getIdentifier()
with this column value to get the resource ID, which I can then use to
lookup the localized string.  The API doc warns about the performance
of this method though, so presumably the lookup would need to be
cached.

Are there better ways of handling this?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to