I am trying to create a dictionary application on Android. I have a database of 80000 articles. When user enters a word in an EditText
, I want to show suggestions in a ListView, To do that I use the following code:
public Cursor query(String entry){
String[] columns = new String[]{"_id", "word"};
String[] selectionArgs = new String[]{entry + "%"};
return mDB.query("word", columns, "word LIKE ?", selectionArgs, null, null, null);
}
and I use SimpleCursorAdapter for the ListView.
The problem is that suggestions appear very late. I think the reason is LIKE
in the SQL. I do not know any other way to do that. Is there anything I can do to boost the performance of getting the suggestions?