Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Searching google images from java code

 
david luis
Ranch Hand
Posts: 53
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2700
IntelliJ IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
david luis
Ranch Hand
Posts: 53
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2700
IntelliJ IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this is a great start.
 
david luis
Ranch Hand
Posts: 53
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 69
IntelliJ IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)?
 
david luis
Ranch Hand
Posts: 53
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works fine. Did you download the correct JSON library?
 
david luis
Ranch Hand
Posts: 53
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouter Oet wrote:Works fine. Did you download the correct JSON library?


Thanks.
I have this library : json-lib-2.4-jdk15.jar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic