Yes, as far as I know, you can assume that the order of the elements will be the same every time, which means that you can safely define key / value pairs using separately declared xml arrays. Take a look at the API demos (e.g. arrays.xml ) and you will see that Google uses the same method to specify a static key / value pair. In particular, you can infer this from entries_list_preference and entryvalues_list_preference . In fact, if you think about it: it hardly makes sense to suggest the attributes entryValues and entryValues to point to static resources, for example. a ListPreference if their order is not guaranteed.
Addendum: multidimensional arrays are not supported in xml. However, you can write your own XML parser to handle these cases, which is actually not as difficult as it might seem. You will probably need more time than just defining two one-dimensional arrays.
source share