• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Midlet running background

 
Song Lixin
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had think that a Midlet is paused when it's brought background. And it's not running anymore there.
Today, I read the javadoc of Display and it's seems my option was wrong. Can somebody give me some hints about:
1) When will a Midlet get background?
2) When will a Midlet get foreground?
3) When a Midlet get background, will it's pauseApp get called?
4) When a Midlet's pauseApp get called?
5) When a Midlet's startApp get called?
 
Reghu Ram Thanumalayan
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My opinion is that even though the MIDlet is in background, it is could be either running, paused or the JVM itself could be preempted (the application would be suspended). All this is upto the device implementation.

From the MIDP 2.0 Spec,
An application is said to be in the foreground if its current Displayable is actually visible on the display device and if user input device events will be delivered to it. If the application is not in the foreground, it lacks access to both the display and input devices, and it is said to be in the background.

Since the spec doesnt mention anything about what happens to the state of the midlet when this switching happens, it is upto the device implementation to take care of it.

Found this thread interesting, while searching for more info on this.

State of Midlet on incoming call

[ June 13, 2006: Message edited by: Reghu Ram T ]
[ June 13, 2006: Message edited by: Reghu Ram T ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic