aspose file tools*
The moose likes Java Micro Edition and the fly likes Ques abt j2me urgent(Double buffer) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Ques abt j2me urgent(Double buffer)" Watch "Ques abt j2me urgent(Double buffer)" New topic
Author

Ques abt j2me urgent(Double buffer)

madan singh
Greenhorn

Joined: Dec 29, 2005
Posts: 18
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

Joined: Feb 05, 2001
Posts: 17250
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Ramender Mall
Ranch Hand

Joined: Sep 08, 2005
Posts: 311
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..
 
jQuery in Action, 2nd edition
 
subject: Ques abt j2me urgent(Double buffer)