I'm developing and app, which has to store elements from an ftp server to a local sqlite database on an Android device and display the elements after a search. It's been done and it's working.
Now i want to add a search method that is not case sensitive. For instance if there are apples with names such as Red apple, yellow Apple, GreeN APPle... etc. they should all be displayed when searching with keyword apple or Apple or APPle. So far i've tried to make the search argument to lower or upper case, but it doesn't work when you throw in a random generated string. Is there a way to bring this functionallity wihtout proccessing outside of the database and if so, how?
This is the source for creating the table:
private static final String DATABASE_CREATE_ITEMTABLE =
"create table ItemTable(itemId text primary key, itemName text, itemGroup text);";
This is the source for the query:
private Cursor execQueryLike(String name) {
name = "%" + name + "%";
return database.query(DB_TABLE_ITEM, columnsitemTable, column
+ " LIKE ? ", new String[] { name }, null, null, KEY_COLUMN_ITEM_NAME, null);