How to get Google search results in Android using Java?

喜夏-厌秋 提交于 2019-12-12 17:51:11

问题


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?


回答1:


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.

You can simply make a http call and parse the JSON response when it comes back.

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



来源:https://stackoverflow.com/questions/12356978/how-to-get-google-search-results-in-android-using-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!