2013-10-21 39 views
7

嗨,我想添加谷歌搜索API到我的應用程序,搜索結果應該顯示在列表視圖中......任何一個可以給我一些例子或告訴我怎麼做它??將谷歌搜索API添加到Android應用程序

+0

檢查此鏈接它會幫助你。 http://developer.android.com/guide/topics/search/index.html – Arshu

回答

2

這..

Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); 
String keyword= "your query here";  
intent.putExtra(SearchManager.QUERY, keyword);  
startActivity(intent); 

怎麼樣基於語音的搜索..

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); 
+0

可以請你發送你的總代碼 – kumar

+0

我記得有可能爲谷歌搜索應用程序提供搜索結果,並且這是宣佈的很久以前。你知道在文檔中哪裏可以找到這樣的東西嗎? –

2

這是一個很好的例子,在你的Android應用程序中實現谷歌搜索Implementing google search 。希望它有幫助。