• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Searching google images from java code

 
Ranch Hand
Posts: 69
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 69
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this is a great start.
 
david luis
Ranch Hand
Posts: 69
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 "


 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 69
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Works fine. Did you download the correct JSON library?
 
david luis
Ranch Hand
Posts: 69
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic