posted 12 years ago
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.
2. How we implement double buffer in MIDP 1.0.
3. Why we use thread in j2me application.
posted 12 years ago
You answer the call. It should pause your application, hence the pause method in the MIDlet class.
Sorry, don't remember this answer.
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
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
posted 12 years ago
-> 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..
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

- Ramy..
