You can use a filter like FilterQueryProvider
with LIKE %
command which will try to match character more efficiently rather than just pulling out the whole information.
Example,
// select query
String sql = "";
sql += "SELECT * FROM " + tableName;
sql += " WHERE " + fieldObjectName + " LIKE '%" + searchTerm + "%'";
sql += " ORDER BY " + fieldObjectId + " DESC";
sql += " LIMIT 0,5";
Source:
Android AutocompleteTextView with Database
Performance optimization tips:
Create index for your column and avoid scan operations by running a query analysis. Scan operations are much slower than search operations.
4
solved Fill AutocompleteTextView on letter click [closed]