Hi i would like to add google search api to my application.and the search result should be shown in a list view...can any one send me some example or tell me how to do it??
Asked
Active
Viewed 1.8k times
7
-
Check this link it will help you. http://developer.android.com/guide/topics/search/index.html – arshu Oct 21 '13 at 12:33
2 Answers
6
Here it is:
import android.app.SearchManager;
// ...
Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
intent.putExtra(SearchManager.QUERY, "Search query");
startActivity(intent);
Voice-based search:
import android.speech.RecognizerIntent;
// ...
Intent sp = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
sp.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
sp.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speak please");
startActivity(sp);
-
1
-
1I remember that it's possible to provide search results for the Google-Search app, and that this was announced a very long time ago. Do you know perhaps where to find such a thing in the docs? – android developer Jun 09 '15 at 16:10
2
Here is a good example on implementing google search in your android application Implementing google search .Hope it helps.

Community
- 1
- 1

Illegal Argument
- 10,090
- 2
- 44
- 61