• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to send bytearray from Servlet to Midlet application?

 
Archana Maharjan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone!
I'm trying to send bytes from servlet to midlet so that i could turn that bytes back to image and display in midlet.
Below are my codes!

//For Servlet


//For Midlet


What should I do in above codes to get screencapture in midlet application? Thanking in advance....
 
lokesh jain
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
You need to treat midlet as the WebService client and you can call the method in the midlet then like this


here dbss.DB(DataQuery, UsrNam, Pswrd,FilNam) is the method of the web service .java file.

regards
Lokesh
 
Archana Maharjan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Lokesh!
Is there any possible way to display that screencapture without using the database?
Is the way I've passed the bytearray into midlet application correct?
Is the way I'm getting the bytearray in midlet application through servlet correct?
And I want to draw that image in the canvas of the midlet.
I have ControlPCMidlet midlet application, LoginValidateThread where run thread invokes the invokeservlet.
Wht should I do?
 
lokesh jain
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Archana,
I have given you an example only, you can use the screen capture without use of Database things. To pass byteArray, you need to make the Midlet as client of the servlet. Yes, you can send byteArray from servlet to Midlet. You need to use Canvas class in midlet.
 
lokesh jain
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Here I would like to give you a link, which performs servlet to midlet communication. webpage

I think your doubt will be cleared.

regards
Lokesh
 
Archana Maharjan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Lokesh ji. It is solved now!
 
lokesh jain
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
That's good !! Can you tell me, how you did it. It will add to my knowledge base as well.


regards
Lokesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic