I have a .txt file in android that I want to read. I first stored it in a raw directory but now I want this file in many languages and android to read the good file according to the language of the device. Do you know where and how I should store this file?
Asked
Active
Viewed 63 times
0
-
By the way. https://stackoverflow.com/questions/6420293/reading-android-raw-text-file – OneCricketeer Sep 13 '17 at 21:30
1 Answers
2
Store your default text file — that you want to use if nothing else matches — in res/raw/
as you are now.
Store translations of the file to other languages in peer directories (e.g., Spanish in res/raw-es/
).
This is how string resources work in res/values-.../
directories. You are simply applying the technique to text files in res/raw-.../
directories.

CommonsWare
- 986,068
- 189
- 2,389
- 2,491