Implement QSB like suggestions in android app

502 views Asked by At

I need to give a search box in my android app. As the user starts typing in the search text, I need to show him relevant suggestions. (As we see in the google-search widget on the home screen. If we see from the logs, com.android.quicksearchbox/.SearchActivity is started with android.search.action.GLOBAL_SEARCH intent and it searches in following: corpora:[web, apps, com.android.contacts/.activities.PeopleActivity]).

Only thing is I need the suggestions to be displayed from the web & my application DB.

Any idea how to implement this ? Do I need to implement my own SuggestionsProvider or can I directly use the native implementation? If so, how?

1

There are 1 answers

1
AndroidGuy On BEST ANSWER

I think i figure it out myself.

Went through Searchable Dictionary code & QuickSearchBox code in android source.

Need two start 2 activities in a background thread. One will search for the search-term in my DB & other will search the same in Google. All the results will be seen in the suggestion list.

Google Suggest API provides suggestions as the user enters the text.