问题描述
我想谷歌搜索功能添加到我的Android应用程序。我想创建一个布局,我可以显示不同的分支(书籍,视频,地图等)的结果。我怎样才能得到的结果编程?任何API和样品?
I want to add Google search functionality to my Android app. I want to create one layout where I can display results from different branches (Books, Videos, Maps, etc). How can I get results programmatically? Any API and samples?
推荐答案
将是您正在寻找的API。
Google Web Search would be the API that you are looking for.
在搜索请求中,可以指定一个纬度和经度的文字去附近的地方一个参考,如果你正在做一个基于位置的搜索。 是参考参数搜索请求。
In the search request, you can specify a latitude and longitude with the text to get a reference to the nearby places, if you are doing a location based search. Here is the reference to the parameters for the search request.
您可以简单地做一个HTTP调用和分析JSON响应,当它回来。
You can simply make a http call and parse the JSON response when it comes back.
不过,是,谷歌鼓励你,而不是使用新的API去$ p $的pcated之一。
However, CustomSearch is the new API that Google encourages you to use instead of the deprecated one.
这篇关于如何使用Java来获得谷歌搜索结果中的Android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!