A
A
Anatoly2015-08-25 16:46:42
Android
Anatoly, 2015-08-25 16:46:42

Using string resources... how?

I want to fill a string resource file with arrays of this type:

<string-array name="Jungle Book">
        <item>50</item>
        <item>детский</item>
        <item>джунгли</item>
        <item>приключения</item>
        <item>... довольно таки длинный текст... (500 знаков)</item>
    </string-array>

Then, in the application code, make arrays based on them, as in the example from the office. documentation
String[] planets = res.getStringArray(R.array.planets_array);

But then I realized that I would have to initialize a lot of arrays, about 100, maybe more. And I thought that I was doing something wrong, can you tell me how to implement this correctly?
Bases decided not to use, tk. I would like to further tighten the localization.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Emin, 2015-08-25
@TonyWrong

Use a database, it can be populated on first run from a json file.
You can see how it's done in the Google app iosched2014
You can start right here

B
belozerow, 2015-08-25
@belozerow

Can you use a database?
There is no problem to use different databases for different languages

R
Rustem Saitkulov, 2015-08-28
@atetc

Throw a file with strings / separators into raw and organize reading from it (by the way, raw even supports localization)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question