5

I want to know the best location for me to put the following string resources. I want to create a location filter box which users would select the location based on "District", "Subway Station","landmark",etc in at least 2-3 languages.

In the mean time, i achieve this feature by using "Sring-array" in "strings.xml" in my project, which should allow me to handle multi-languages.

<string-array name="HK_Districts">
  <item >Tsim Sha Tsui</item>  
  <item >Causeway Bay</item> 
   ....
</string-array> 

This method should work in a single city but if i want to make expansion into other cities, i just think this will create over 10'000 lines in "strings.xml " and this seems to be very complicated for data management.

I am new to Android and want to know if there are better alternatives to work it out, like using the "assets" folder, etc.

enter image description here

1 Answer 1

5

just put your file in /values-{language}/arrays.xml

if folder doesn't exists, you should create it.

example: /values-es/arrays.xml

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.