Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Google Search API to Android App [closed]

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??

like image 313
user2713202 Avatar asked Oct 21 '13 11:10

user2713202


2 Answers

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);
like image 174
Nizam Avatar answered Sep 23 '22 01:09

Nizam


Here is a good example on implementing google search in your android application Implementing google search .Hope it helps.

like image 38
Illegal Argument Avatar answered Sep 25 '22 01:09

Illegal Argument