【问题标题】:Adding Google Search API to Android App [closed]将 Google 搜索 API 添加到 Android 应用程序 [关闭]
【发布时间】:2013-10-21 11:07:25
【问题描述】:

您好,我想将 google 搜索 api 添加到我的应用程序中。搜索结果应显示在列表视图中...谁能给我一些示例或告诉我如何做??

【问题讨论】:

标签: android google-search-api


【解决方案1】:

这里是:

import android.app.SearchManager;

// ...

Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);  
intent.putExtra(SearchManager.QUERY, "Search query");    
startActivity(intent);

基于语音的搜索:

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

【讨论】:

  • 你能把你的总代码发给你吗
  • 我记得可以为 Google-Search 应用程序提供搜索结果,而且这是很久以前宣布的。你知道在文档中哪里可以找到这样的东西吗?
【解决方案2】:

这是在你的安卓应用程序中实现谷歌搜索的一个很好的例子Implementing google search .希望对您有所帮助。

【讨论】:

  • 链接已失效。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多