Sun Microsystems 2 Wireless Office Headset User Manual


 
30 Multitasking Guide May 2007
Default Policy
The Java Wireless Client software supplies a default policy for how a MIDlet gains
the foreground. It enables the user to switch to an application list screen at any time
by pressing a hot key. By default, the hot key is the Home key found on many
platforms. The application list screen shows a list of all running MIDlets. When the
user brings up the application list, the MIDlet that had been in the foreground is
moved into the background. The user scrolls through the application list and
chooses the MIDlet to bring to the foreground.
Native code can request the application list to be shown by sending a
SELECT_FOREGROUND_EVENT into the system. See the code in the file
win32app_export.c for an example of how this event is generated in response to
the pressing of the Home key. Use the same technique of sending a
SELECT_FOREGROUND_EVENT to show the application list in response to some other
external event.
Alternative Policies and Their Implementations
Policies for switching foreground applications are highly dependent on a device’s
existing user interface. If your device already enables a user to switch between
native applications in a particular way, use the same or similar policies for the Java
Wireless Client software. Users expect consumer products, such as small devices, to
be predictable, easy to learn, and easy to use. Making the policies of your Java
Wireless Client software as similar as possible to the native policies users already
know and use speeds acceptance of the new functionality. See the MIDP 2.0 Style
Guide (Addison-Wesley, 2003) for more information.
Scheduling the CPU
The CPU is a shared resource that requires separate policy decisions. The foreground
application has exclusive access to the display and the input mechanisms, but you
can have a policy that enables it to share the CPU with the background applications.
Your policy depends at least in part on the capabilities of your device.