ppmoore
03-31-2009, 05:34 AM
Hello,
I have a simple application to read a dictionary text file
File filePath = new File( "/data/app-private", "dictionary.txt");
ArrayList<String> dictionary = new ArrayList<String>();
BufferedReader input = new BufferedReader(new FileReader(fileName));
while( ( fileLine = input.readLine() ) != null )
{
dictionary.add(fileLine);
}
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit);
ArrayAdapter<String> adapter = new ArrayAdapter<String>( this,
android.R.layout.simple_dropdown_item_1line,
dictionary);
textView.setAdapter(adapter);This works. However it becomes very slow if there are many entries in the dictionary string list.
Can I speed it up?
How does the ArrayList<String> internally organise its entries?
Is there a way to combine it with one of the Hash classes?
Many thanks,
Paul
I have a simple application to read a dictionary text file
File filePath = new File( "/data/app-private", "dictionary.txt");
ArrayList<String> dictionary = new ArrayList<String>();
BufferedReader input = new BufferedReader(new FileReader(fileName));
while( ( fileLine = input.readLine() ) != null )
{
dictionary.add(fileLine);
}
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit);
ArrayAdapter<String> adapter = new ArrayAdapter<String>( this,
android.R.layout.simple_dropdown_item_1line,
dictionary);
textView.setAdapter(adapter);This works. However it becomes very slow if there are many entries in the dictionary string list.
Can I speed it up?
How does the ArrayList<String> internally organise its entries?
Is there a way to combine it with one of the Hash classes?
Many thanks,
Paul