0

Just like opening a video link in the youtube app (where the programmer needs to specify the app and activity package explicitly). How can I perform a Google search in the Google search app programmatically?

Shreemaan Abhishek
  • 1,134
  • 1
  • 7
  • 33

1 Answers1

-1

Google offers a public search webservice API which returns JSON: http://ajax.googleapis.com/ajax/services/search/web. Documentation here

Java offers java.net.URL and java.net.URLConnection to fire and handle HTTP requests.

JSON can in Java be converted to a fullworthy Javabean object using an arbitrary Java JSON API. One of the best is Google Gson.

Nishith
  • 107
  • 1
  • 9
  • The link broken and it seems as though nowadays - Aug 2023 - there is no official API. There are 3rd party scrapers that provide API like BeautifulSoup and others. – Oded Ben Dov Aug 11 '23 at 05:40