Code examples and code modules

Running MIDlets in flip-closed mode

What happens when the flip is closed on a Sony Ericsson P900 is that the MIDlet’s pauseApp() method is called and the pause state is entered. In the pauseApp() method, the MIDlet, to quote the spec, “must release shared resources and become quiescent” but the MIDlet does not die. For example, it makes sense to let the MIDlet listen to incoming connections on a blocking call while in the pause state and in that way monitor a network resource. Devices running Organiser R2* or later will remain asleep during such calls so it will be very cost effective in terms of device standby time. Another monitoring approach is to periodically poll the resources of interest. This latter approach is used in the following MIDlet example.

Download Running MIDlets in flip-closed mode (6.8 KB)