Therefore, the code for the Palm and Pocket PC device becomes slightly more complicated with the
addition of a secondary thread used only to make the HTTP connection. The code in the sample
programs shows how this is done. However, if you don’t plan to deploy your application to the
BlackBerry platform, you won’t need to worry about this issue.
Writing one Java application that will run intuitively for the user on Palm OS4, Pocket PC 2002, and BlackBerry OS 3.2 platforms is not as straightforward as desktop or server Java programming. The
MIDP environment is not as robust as J2SE or J2EE, and the differences among devices can play
havoc with your cross-platform plans. You need to take care to ensure that the GUI controls you
use work properly and somewhat consistently on each deployed platform. In addition, the user
interface requirements must not exceed the various devices’ capabilities.
To some extent, you must take a least-common-denominator approach and work around the
various characteristics and limitations of your target devices to create an application that is usable
on each of them. In addition, you might have to add complexities that are unnecessary on some
platforms in order to satisfy the requirements of others. For example, the addition of a secondary
thread for HTTP connections for BlackBerry OS platforms makes code more complex than necessary
for Palm OS4 and Pocket PC 2002 devices.
In the end, it is worth putting in the additional work and complexity to have one application run on
multiple devices. Doing so reduces code maintenance and the time and effort needed to track
multiple versions of the same application. Furthermore, this approach takes advantage of the
cross-platform features of the Java programming language. Over time, as J2ME and MIDP improve,
the differences between the various MIDP implementations and their behavior on the various devices
will diminish. This will result in an easier and more straightforward path to cross-platform J2ME and