PLEASE,
I know this question has been asked many times, but I still can't get my code to work.
I have a text file in my assets folder called words.txt. There is one word per line in each line of that text file with no blank lines. I want to put every word in an array.
First I tried using scanner, but after reading many stackoverflow threads I found out I needed to use AssetManager.
Here's what I tried:
AssetManager assetManager = getAssets();
InputStream inputStream = assetManager.open("words.txt");
It gives me the error message: default constructor cannot handle exception type IOException thrown by implicit super constructor...
before I even do anything else. I don't know what this means.
Also, looking at the api, it seems like InputStream can only read bytes. How can I read words from the text file?
The threads are overwhelming because it seems like each answer proposes a different method, using InputStreams, BufferedStreams, FileInputStreams, File, Res folders, Asset folders, and lots of other language I am unfamiliar with. I am just learning to develop android apps and have limited java experience.