Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ques abt j2me urgent(Double buffer)

 
madan singh
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.What happen if (J2ME)game MIDlet is running and any phone call comes.

2. How we implement double buffer in MIDP 1.0.

3. Why we use thread in j2me application.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by madan singh:
1.What happen if (J2ME)game MIDlet is running and any phone call comes.


You answer the call. It should pause your application, hence the pause method in the MIDlet class.

Originally posted by madan singh:

2. How we implement double buffer in MIDP 1.0.


Sorry, don't remember this answer.

Originally posted by madan singh:

3. Why we use thread in j2me application.


For the same reasons why we might use threads in regular Java. When we don't want to hold up and freeze the application for some long running process when the user is waiting. Users hate when that happens.

Mark
 
Ramender Mall
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2. How we implement double buffer in MIDP 1.0.


-> Create a mutable image of screen height and width.
-> Used getGraphics() method to obtain the graphics context of the image say mGraphic.
-> Use your own paint method like myPaint(Graphics g) something and call it like myPaint(mGraphic).
-> In the default paint(), use drawImage to draw this mutable image only.

I tried this method only once, the result was good on emulator and returned the expected effect on device also ( although induced some other bugs ), and as I was working on a MIDP 2.0 device, so later I simply replaced Canvas class by GameCanvas, which provides user with an option of double buffering.


- Ramy..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic