Magazine
 
Quick Review:Ajax
 

Cross-platform programming with Java technology and the IBM Web Services Toolkit for Mobile Devices

 

Device differences

The user interacts with each of the devices I’ll discuss here differently, due to their differing designs. For the purposes of this article, I’ll describe the differences between the devices I worked with during the development of the tool kit: the Palm i705 Handheld running Palm OS4, the Compaq iPAQ 3670 Color Pocket PC running Pocket PC 2002, and the BlackBerry 5810 Handheld running BlackBerry OS 3.2 platform, a Java language operating system. Understanding these differences was key in developing an application that ran on all the devices.

Note that the IBM J9 Virtual Machine that runs on Palm OS4 platform does not support the INETLIB networking library on the Palm i705 device. Therefore, there is no way to make a network call with this VM on this device, and thus the Web Services Tool Kit for Mobile Devices does not support the Palm i705 Handheld. (Other Palm OS4 devices are supported.) However, non-networking applications can still run on the Palm i705 Handheld to help pinpoint user interface issues that arise with Palm OS4 devices.

  • Palm i705 Handheld: The user interacts with this device via a touchscreen. Menus are also available but are accessed via the menu button provided by the device.
     
  • iPAQ 3670 Color Pocket PC: The user interacts with this device via both a touchscreen and a five-way hardware button on the bottom of the device. As you’ll see, the touchscreen does not work with all GUI controls available in MIDP, making your choice of GUI control important.
     
  • BlackBerry 5810 Handheld: The user interacts with this device via a trackwheel and a hardware selection button. This device does not support a touchscreen and is therefore completely menu driven. Because there is no touchscreen, the process of selecting items is different than it is on the other devices. You use the trackwheel to change the highlighted item, then use the menus or the spacebar to select the highlighted item.

User interface differences: Menus and buttons
Some of your design decisions are going to be based on the inherent differences in the devices, as well as the differences in how data is rendered by the different MIDP implementations. For instance, as noted, the BlackBerry device does not have a touchscreen and operates from a menu-driven interface. Therefore, you must design your application to be menu driven if you want it run unmodified on each device.

MIDP contains a Command class that the user can trigger; this class is used to encapsulate operations. Because the BlackBerry device is completely menu driven, all Command objects are displayed as menu choices on its UI. On the other devices, the MIDP implementation determines whether the device displays the Command objects as menu choices or as buttons.

For example, on the Palm i705 Handheld, all Command objects are displayed as menu items. On the iPAQ device, in contrast, they are preferably displayed as buttons; but when there are too many Command objects to fit on the screen, a Menu button is added that, when pressed, displays the remaining Command objects in a menu. In your code, you can determine the order in which these objects appear: when you create Command objects, you create them with a CommandPriority. The lower the number, the higher the priority. On the iPAQ device, the Command objects with the highest priority are given preference to display as buttons rather than menu items.

Because of these differences, when you are designing an application to run unmodified on these various devices, it is important to design the application’s flow around the Command class and accept that your Command objects will display either as buttons or menu items depending on the device characteristics.

June 2008 | Java Jazz Up |35
 
previous
index
next
 
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,   Download PDF