This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Product and Other Certifications and the fly likes Midlet running background Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "Midlet running background" Watch "Midlet running background" New topic

Midlet running background

Song Lixin

Joined: Nov 11, 2003
Posts: 19
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?

SCJP1.2<br />SCJD<br />SCMAD
Reghu Ram Thanumalayan
Ranch Hand

Joined: Oct 21, 2003
Posts: 193
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 ]

Cheers,<br />Reghu Ram T<br /> <br />SCJP 1.4 - 98 %, SCBCD 1.3 - 94 %, SCMAD 1.0 - 92 %
I agree. Here's the link:
subject: Midlet running background
It's not a secret anymore!