I have a words.txt file which I have placed in my res/raw folder. The words in the file are separated by space. I\'m having a hard time writing
Read from res/raw folder to String
InputStream inputStream = getResources().openRawResource(R.raw.yourtextfile);
BufferedReader bufferedReader= new BufferedReader(new InputStreamReader(inputStream));
String eachline = bufferedReader.readLine();
while (eachline != null) {
// `the words in the file are separated by space`, so to get each words
String[] words = eachline.split(" ");
eachline = bufferedReader.readLine();
}