Sun Microsystems 2 Wireless Office Headset User Manual


 
29
CHAPTER
4
Other Multitasking Issues
Multitasking raises some issues related to the behavior of the Java Wireless Client
software. This chapter describes the issues, how they are handled by the Java
Wireless Client software, and possible alternatives.
Most of the issues discussed in this chapter relate to the implementation of the Java
platform AMS. The same issues must be addressed by the Native AMS.
Switching the Foreground MIDlet
In a system that cannot run concurrent MIDlets, each MIDlet effectively runs alone
and it potentially has access to all the resources available on the system. The entire
runtime environment is shut down when the MIDlet exits. Multitasking
environments work differently.
With multitasking, a MIDlet is not alone on the system. The MIDlet runs in its own
environment (its task), but at most one MIDlet can have access to the device’s display
and to the device’s input mechanisms, such as keypad and pointer events. No
MIDlets have access to the device’s display and input mechanisms if the user is
interacting with a native application. Managing which MIDlet has access to the
device display and input mechanisms necessitated the introduction of the foreground
and background states:
A foreground MIDlet can draw on the screen and receive keystrokes (and pointer
events, if the device has pointer input).
A background MIDlet cannot draw to the device display, and the system ignores
any graphics operations it emits. A background MIDlet cannot receive any
keypad or pointer events.