3

How to get search suggestions when I type some text in my edittext. I am not talking about the interface, but how do i get the actual suggestions like when you type something in the google search bar. Are there any APIs available?

Thx! Rahul.

rahul
  • 6,447
  • 3
  • 31
  • 42
  • Sounds like this as you asked, with some answers. http://stackoverflow.com/questions/6428502/google-search-autocomplete-api – gkiar Jul 10 '12 at 17:18
  • I tried the guides from google docs. I can't get it to work. The cursor returns the valid search suggestions. But no search suggestions appears below the search box. – Neon Warge Sep 13 '15 at 03:32

1 Answers1

1

The Google Suggest API seems to be what you're looking for:

http://blogoscoped.com/archive/2006-08-17-n22.html

You can try it on that page, and it will show you the results of your query as XML, when you click submit.

Then, on Android you would use an XML parser, and there's a good example of that here:

http://www.ibm.com/developerworks/opensource/library/x-android/

Here's the official Android documentation on parsing XML: http://developer.android.com/training/basics/network-ops/xml.html

Alex W
  • 37,233
  • 13
  • 109
  • 109