Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7759625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:40:41+00:00 2026-06-01T13:40:41+00:00

Can I count on string arrays within the strings.xml resource file to be parsed/deserialized

  • 0

Can I count on string arrays within the “strings.xml” resource file to be parsed/deserialized in the same order every time?

If anyone can cite any documentation that clearly spells out this guarantee, I’d appreciate it. Or, at the very least, offer a significant amount of experience with this topic.

Also, is this a best practice or am I missing a simpler solution?

Note: This will be a small list, so I’m not looking to implement a more complicated database or custom XML solution unless I absolutely have to.

<!--KEYS (ALWAYS CORRESPONDS TO LIST BELOW ??)-->
<string-array name="keys">
    <item>1</item>
    <item>2</item>
    <item>3</item>
</string-array>

<!--VALUES (ALWAYS CORRESPONDS TO LIST ABOVE ??)-->
<string-array name="values">
    <item>one</item>
    <item>two</item>
    <item>three</item>
</string-array>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:40:42+00:00Added an answer on June 1, 2026 at 1:40 pm

    Yes, as far as I’m aware you can assume that the order of items will be the same each time, meaning you can safely define key/value pairs using separately xml-declared arrays. Have a look at the API demos (e.g. the arrays.xml file) and you’ll see that Google uses the same methodoly to specify static key/value pairs. More specifically, you’ll be able to deduce this from entries_list_preference and entryvalues_list_preference. Actually, if you think about it: it would hardly make sense to offer entries and entryValues attributes for pointing to static resources for e.g. a ListPreference if their order wouldn’t be guaranteed.

    Addendum: Multi-dimensional arrays in xml are not supported. You can however write your own xml parser to handle those cases, which actually isn’t as hard as it may sound. It would probably take you more time though than simply defining two one-dimensional arrays.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I limit a string's word count in XSLT 1.0?
Crux of my problem: I've got an XML file that returns 20 results. Within
std::map<std::string, int> m; // Can I make assumption that m[NoSuchKey] will return 0? std::cout
I can count the rows in the dataset that the table consumes, but this
I have a table and can count the number of rows using var count
I would like to know how I can count the number of unique values
I have a SQL which can count the condition(Bad,Poor,Worse) in a day and group
I am returning form elements into a form from ajax. I can count the
How can we count space between text in PHP? example: hi how are you?
How can I count to 10 while summing the numbers in VBA?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.