Using IN
keyword in SQLite would allow you perform search with a set of multiple values. For example:
SELECT * FROM table WHERE first-name IN ('a', 'b', 'c', 'd');
Now what you can do is to build an input (searchable words) parameter using any loop and replace it in the IN
brackets.
For example:
String names = "'a', 'b', 'c', 'd'"; /* build it through loop */
Cursor c = db.rawQuery("SELECT * FROM table WHERE first-name IN (?)",
new String[]{names});
With multiple columns:
String names = "'a', 'b', 'c', 'd'"; /* build it through loop */
Cursor c = db.rawQuery("SELECT * FROM table WHERE first-name IN (?)
OR last-name IN (?) OR subject IN (?) OR result IN (?) OR grade IN (?)",
new String[]{names, names, names, names, names});