Found a solution myself.

You should create an URL with adress "http://ajax.googleapis.com/ajax/
services/search/images?v=1.0&q=" and add after "q=" your keywords for
search. Then if you create a reader from this url, you'll get an xml
as a responce.
Here's an example:

URL url = new URL("http://ajax.googleapis.com/ajax/services/search/
images?v=1.0&q=pamela+anderson");
BufferedReader reader = new BufferedReader(
                        new InputStreamReader( url.openStream() )    );
String line;
StringBuffer output = new StringBuffer();
while ( (line = reader.readLine()) != null ) {
       output.append(line);
}
reader.close();


Now output contains the xml returned from google image search.

Good luck!
Andrew


On 12 ноя, 02:01, pti4ik <[email protected]> wrote:
> Hi everybody!
> There's an interesting problem: I need to search for images on web and
> then show them in my application. I'm thinking of usingimages.google.com. How 
> can I get results from this image search?
> I tried simply creating URL object with adress 
> "http://images.google.com/images?q=keyword";, but got a 403 Forbidden error.
> I also know AJAX search api, but don't have any idea of how to
> implement this in my app because it is for using in websites!
> So what would you advise to get search results fromimages.google.com?
>
> Andrew

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to