1

I would like to ask if my concept of implementing search in my application is correct and whether it could be improved. I will provide any details needed therefore I believe my question is well-suited for this site.

  1. I need to implement a search over large SQLite tables (~20 columns, possibly 1000-1500 records - you can think of it as a catalogue of items in a supermarket). The search should be performed on more than 1 table (i.e. 1 catalogue) but I can also force the user to choose specific table (though I would like to avoid it).
  2. To make the search efficient, I'll use the SQLite FTS3 tables.
  3. I want to make a fast search that will quickly show results as the user types a query string. For example, when a fragment of product manfufacturer is entered all of the products matching that string should be shown. The perfect solution would be if the user could enter fragment of one column and fragment of another at the same time, though I think that could be a little too much for an Android device.

Questions:

  1. Should I use a SearchView together with a a ListView (and show search results in the ListView) or should I use the AutoCompleteTextView?
  2. Are the FTS3 tables the right way to go (i.e. will it be fast enough) to effectively perform search over several (large) tables?

I am targeting Android versions >= 3.0.

syntagma
  • 23,346
  • 16
  • 78
  • 134

1 Answers1

0

If you want to have a few line of code, you should use AutoCompleteTextView for it has ready built-in listener (ontextChangelistener -- wherein you can show the suggestions every time the text changes ) and list/ container for suggestions.You can create your own adapter to customize the design of the list.

FTS3 or FTS4 would be great in querying big amount of data.

waelhe
  • 381
  • 2
  • 13