Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to send bytearray from Servlet to Midlet application?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Everybody! Do the Funky Monkey! Like this tiny ad!
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic