vendredi 7 août 2015

Dictionary Search in Android Keyboard

I intend to make a keyboard and integrate a custom dictionary for it (without ContentProvider). I searched in the net and found the android example of Searchabe Dictionary

Here a FTS Virtual Table was created and the query was passed from an activity using SearchManager.QUERY to the below method

public Cursor getWordMatches(String query, String[] columns) {
    String selection = COL_WORD + " MATCH ?";
    String[] selectionArgs = new String[] {query+"*"};

    return query(selection, selectionArgs, columns);
}

My question is if I have the string for what I will be searching in the database already, how to build the query(equivalent to SearchManager.QUERY as mentioned in the example) by myself as my keyboard will not always use Searchable fields?

Aucun commentaire:

Enregistrer un commentaire