I have a problem with fast read txt file to ArrayList. If I want read a file size 0,9MB, I must wait 5min. If files size is 34MB (partialy, because android does not accept larger than 1MB files), it's completely not working. I think that process should be max few second.
This is a code:
String word;
public ArrayList<String> dictionary = new ArrayList<String>();
public void setup()
{
try {
AssetManager assetManager = getAssets();
InputStream inputf;
inputf = assetManager.open("dict_1.txt");
reader = new BufferedReader(new InputStreamReader(inputf));
word = " ";
while(word != null)
{
word = reader.readLine();
if (word != null)
dictionary.add(word);
}
if(reader.equals("null")) println("No file found");
} catch (NullPointerException e) {
e.printStackTrace();
println("No file found");
} catch (IOException e) {
e.printStackTrace();
}
}
I'm sorry for my english. I hope that all is understadable.