-1

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?

skynet
  • 9,778
  • 5
  • 41
  • 51
AndroidGuy
  • 1,200
  • 4
  • 14
  • 32

1 Answers1

2

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.

AndroidGuy
  • 1,200
  • 4
  • 14
  • 32
  • Hey, could you elaborate a little? like, how do you start Google search activity in a background thread? or how do you get its search results? – mmbrian Aug 06 '13 at 18:51