What's the proper way of importing option lists into an Android app?

Posted by Scott on Stack Overflow See other posts from Stack Overflow or by Scott
Published on 2014-06-09T21:00:46Z Indexed on 2014/06/09 21:24 UTC
Read the original article Hit count: 217

Filed under:
|
|
|

I have been storing option lists for my Android app in a cloud table. For example, categories like "historical fiction","biography","science fiction", etc. I see the following pros and cons:

Pro:

  • I can make changes to the list without sending an app update to Google Play
  • Not normalized - I can use the text in my other data tables instead of a reference ID

Con:

  • App needs to take time to download from the web each time (or at least check for changes)
  • English only

I believe the "proper" way to do this is the use the XML resource files. But I need to make sure the selection references correctly with my data. That is, my app needs to understand that "Poetry" and "Poesía" are the same thing.

Is the correct thing to do:

  1. Forget about it since I'll never get to the point where I'm translating my app anyway
  2. Use a string-array and use the index (0...x) to know what the selection is
  3. Use a 2-dimensional string-array with a reference ID in the first column and the text in the second?

© Stack Overflow or respective owner

Related posts about android

Related posts about Xml