Subscribe

RSS Feed (xml)

Tuesday, March 11, 2008

Wireless Java: Developing with J2ME, Second Edition





Description
  • Although Java is incredibly popular, the standard edition of Java is way too big and bulky to build applications for wireless devices such as PDAs and phones. Thus, Sun has released Java 2 Platform, Micro Edition (J2ME). J2ME has the potential to be as revolutionary in the wireless space as Java has been in the server space.

Wireless Java: Developing with J2ME, Second Edition is updated to include coverage of the next version of programs for mobile Java devices. MIDP 2.0 contains many exciting new features, such as sound HTTPS support, lots of user interface API enhancements, a Game API, and much more. Also, author Jonathan Knudsen makes clear what material is new so readers can still use the book for MIDP 1.0/CLDC 1.0.

Creating a User InterfaceMIDP APPLICATIONS ARE built to run on many different devices without modification. This is particularly difficult in the area of the user interface because devices have screens of all sizes, in grayscale and in color. Furthermore, devices vary widely in their input capabilities, from numeric keypads to alphabetic keyboards, soft keys, and even touch screens. The minimum screen size mandated by MIDP is 96 × 54 pixels, with at least one bit of color depth. As for input, MIDP is fairly openended: devices are expected to have some type of keyboard, or a touch screen, or possibly both.

Given the wide variety of devices that are compliant with MIDP, there are two ways to create applications that work well on all devices:

  • Abstraction: Specify a user interface in abstract terms, relying on the MIDP implementation to create something concrete. Instead of saying something like, “Display the word ‘Next’ on the screen above the soft button,” you say, “Give me a Next command somewhere in this interface.”
  • Discovery: The application learns about the device at runtime and tailors the user interface programmatically. You might, for example, find out how big the device’s screen was in order to scale your user interface appropriately.

The MIDP APIs support both methods. Abstraction is the preferred method because it involves less code in your application and more work by the MIDP implementation. In some cases, like games, you need to be more specific about the user interface; these types of applications will discover the capabilities of a device and attempt to tailor their behavior appropriately. MIDP’s user-interface APIs are designed so that it’s easy to mix the two techniques in the same application.
Download Wireless Java: Developing with J2ME, Second Edition

0 comments: