wood burning stoves 2.0*
The moose likes Java in General and the fly likes Searching google images from java code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Searching google images from java code" Watch "Searching google images from java code" New topic
Author

Searching google images from java code

david luis
Ranch Hand

Joined: Mar 10, 2011
Posts: 44
Hi!

In my project I would like to search image from google search image. How could I do it with java? There is some code somewhere?
Many thanks and sorry for my english!
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

What do you exactly want? Do you want to open a browser? Do you want to imcorparate it into your gui? Is your project a swing/jsf/wicket application?

And did you try this?


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
david luis
Ranch Hand

Joined: Mar 10, 2011
Posts: 44
Thanks!

Well, the project is an android project. I need to load the first image of a google search image in a textview or some component.

Could you help me?
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

I think this is a great start.
david luis
Ranch Hand

Joined: Mar 10, 2011
Posts: 44
Wouter Oet wrote:I think this is a great start.


Thanks, I'm trying but when I do:



It gives me an compilation error:
" The constructor JSONObject(String) is undefined "


Nico Van Brandt
Ranch Hand

Joined: Mar 31, 2011
Posts: 66

Can't be. There is a constructor that takes a String.

JSONObject(java.lang.String source): Construct a JSONObject from a source JSON text string.

Did you download and include the JSON file(s)?


Oracle Java SE6 Certified Programmer
Oracle Java EE5 Certified Web Component Developer
david luis
Ranch Hand

Joined: Mar 10, 2011
Posts: 44
Nico Van Belle wrote:Can't be. There is a constructor that takes a String.

JSONObject(java.lang.String source): Construct a JSONObject from a source JSON text string.

Did you download and include the JSON file(s)?




I try with these code


Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Works fine. Did you download the correct JSON library?
david luis
Ranch Hand

Joined: Mar 10, 2011
Posts: 44
Wouter Oet wrote:Works fine. Did you download the correct JSON library?


Thanks.
I have this library : json-lib-2.4-jdk15.jar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Searching google images from java code