0

I am creating a voting application, and I want users to be able to create polls.

For each poll, there will be an associated image. I was planning on using either Flickr or Google Images to allow users to search for images to utilize in any polls that they create.

I found the site below from Google's documentation, but it looks like it is deprecated:

https://developers.google.com/image-search/v1/jsondevguide?csw=1#sending-a-basic-query

At the end of the day, I would like for the users to be able to query Google Images from an entered string, and then have the results from Google Images display in a GridView. Any advice on how I would write the request and display the JSON results in a GridView would be much appreciated.

tccpg288
  • 3,242
  • 5
  • 35
  • 80
  • How about using https://encrypted.google.com/search?q=USER_QUERY&tbm=isch as the url template and replace USER_QUERY with the string provided by user. Then you could parse the html for the image links using this https://jsoup.org/ library. Once you get the urls you can follow this http://stackoverflow.com/a/9288544/4184412 tutorial on how to make an ImageView out of a downloaded image. Finally, when you have ImageViews, you can add them to a grid as shown here http://inducesmile.com/android/android-gridlayoutmanager-with-recyclerview-in-material-design/ – Dziugas May 17 '16 at 17:47
  • Much appreciated, I will look into that option and certainly let you know if I have further questions! – tccpg288 May 17 '16 at 17:49
  • Ok, I'll try my best to answer them. – Dziugas May 17 '16 at 17:50
  • Are you still proposing I use the deprecated search from above? – tccpg288 May 17 '16 at 17:51
  • Tbh, I had no idea it was deprecated. I simply made a Google image search and removed parts of the url until I had the smallest working url – Dziugas May 17 '16 at 17:54
  • My inclination would be to use Retrofit to make a call to the appropriate URL....would you consider that a good starting point? – tccpg288 May 17 '16 at 19:23
  • That's the old image search. Google has a new image search API: https://developers.google.com/custom-search/ – kris larson May 17 '16 at 21:06

0 Answers0