You need to create a content provider that delivers your custom offers based on the query you have entered so far in the search view. In your searchable.xml file, you configure the minimum length of the search expression that must be reached before requesting offers. This content provider is called an offer provider (it still extends ContentProvider). The content owner is also configured in the searchable.xml file.
There are no restrictions on how the offer provider calculates its offers. You can search the web query in the database or read the file. But the response to the request is in table format. If offers are directly requested from the database, you can use the cursor that the database query responds to deliver the result in the query () method of the content provider. If the result is calculated from one or more sources, you can create the table on the fly using MatrixCursor.
Response lines from the offer provider are used by the search engine to display offers, they are stored in a table. The format of the lines is as follows:
private static final String[] COLUMNS = { "_id", SearchManager.SUGGEST_COLUMN_ICON_1,
The search is described here in more detail: http://developer.android.com/guide/topics/search/index.html
source share