• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retrieving more than one images using http connection

 
pradeep u nair
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear friends
asking you for help again i am implementing a j2me application which retrieves more than one images when one search string is given.but the problem is how to retreive more than one images.the request is send once...then the client shows a problem after the first response.
please tell me what shall i do to implement this
thanking you in advance
pradeep
 
Nidheesh Puthalath
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pradeep,
This requires some implementation logic. that is it.
you can keep some header parameters like number of images, lenght of each image in bytes etc in the http response. then send all the images one after the other in HTTP body. after reading the reasponse u can get the length of each images and put it into different byte arrays(this can be done by using System.arraycopy()). these byte arrays are the different images. u can pass this byte arrays to Image.createImage method call.

Hope this helps u

Nidheesh
 
pradeep u nair
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi nideesh
i tried out your information.now the problem is that the images are being sent from the server side encoded with base64 and being decoded on the client side. but still using the createImage() method shows an illegal argument exception. pleasse help
 
pradeep u nair
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi nideesh
i tried to do it the other way but it proved to be futile.so i used a bit more logic. now i am calling the servlet every time i require an image.thats the only way out i see.after posting this question in many a forums and searching the net for the answers.
Other case is that if it were a bluetooth application, the thing would have worked fine with OBEX protocol.
thanks for all your guys help
Pradeep
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic