如何使用Java来获得谷歌搜索结果中的Andr​​oid? [英] How to get Google search results in Android using Java?

查看:124
本文介绍了如何使用Java来获得谷歌搜索结果中的Andr​​oid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想谷歌搜索功能添加到我的Andr​​oid应用程序。我想创建一个布局,我可以显示不同的分支(书籍,视频,地图等)的结果。我怎样才能得到的结果编程?任何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.

不过, CustomSearch 是,谷歌鼓励你,而不是使用新的API去$ p $的pcated之一。

However, CustomSearch is the new API that Google encourages you to use instead of the deprecated one.

这篇关于如何使用Java来获得谷歌搜索结果中的Andr​​oid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆