Java Reference
In-Depth Information
displayed directly on the main screen. Also, List Item s can hold an Image , which is not
possible for commands.
PDAP
The PDAP user interface is based on the Abstract Windows Toolkit (AWT) that was originally
developed for the desktop. It provides more design freedom than the MIDP UI elements, but it
also loads more responsibility on the developer: Screen formats and sizes may differ significantly
from device to device, and the application should try to adopt to these characteristics. For example,
a configuration panel may fit completely on the screen of one device, but on another device a split
may be necessary. You could achieve such a division by putting both parts in panels and switching
between a CardLayout and a BorderLayout , depending on the actual screen size of the device.
The Choice class is a space-saving, comfortable widget. For PDA applications, it can often be
used as a space-saving alternative to a set of radio buttons or a number of other buttons. The
combination of a Choice with a Cardlayout may be used to simulate tab panes for PDAP.
Summary
In this chapter you learned about some possible program optimizations, allowing enhancement of
your J2ME applications with respect to execution speed and memory consumption. You now
know how to shift application data from the heap to record stores. You have seen some cases in
which it may make sense to split the functionality of an application into a few separate programs
in the same MIDlet or PDAlet suite. Finally, you saw some ways to optimize the user interface of
MIDP and PDAP applications.
The next chapter presents an advanced application example that illustrate integrated usage of the
MIDP and PDAP APIs, which have been described separately in the previous chapters. We will
show how to build an application for both MIDP and PDAP, sharing most of the classes, and
differing only in the implementation of the user interface.
 
Search WWH ::




Custom Search