Browse DevX
Sign up for e-mail newsletters from DevX


Sun's New Wireless Toolkit Keeps Up with the Mobile Joneses : Page 2

As devices grow more capable, so too must our development and emulation testing environments grow. Find out how this first of two anticipated beta releases of the newly renamed Wireless Toolkit from Sun addresses many J2ME developer needs as well as adding support for new APIs.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Figure 1. Addition of HTTP Basic Access Authentication: WTK 2.3 has added the ability to provide username and password for use with HTTP Basic Access Authentication. Note the addition in the Network Configuration tab in the emulator preferences dialog window in 2.3 (left) vs. 2.2 (right).

Developer Enhancements
A number of small, yet helpful, features have been added to the IDE to assist developers in the creation and testing of MIDlet and MIDlet suites. First of all, Sun has added authentication to access the HTTP proxy server via the emulator. When testing MIDlets that make an HTTP connection, the emulator uses the desktop network connection and if your desktop makes connections through a proxy server, your emulator will need to use the same proxy server. Figure 1 shows the Network Configuration tab on both the Emulator Preferences windows in both the WTK 2.2 and 2.3 versions. Note the addition of an authentication username and password for when your proxy server uses the Basic Access Authentication scheme.

This version of WTK also comes with the ability to create a new project out of an existing J2ME application descriptor (JAD) and MIDlet Suite Java archive (JAR) file (see Figure 2). This is particularly useful when you want to take an existing MIDlet suite, copy it, and then modify its descriptor—say for example, to sign the JAR. You could do this manually with previous versions of the WTK, but it was a messy and tedious job.

Figure 2. Create a Project from JAD/JAR: After copying and renaming the JAD and JAR file, you can edit the new JAD file and then create a new WTK project using the new JAD and JAR. To create a new project from the copied JAD/JAR, select Create project from JAD/JAR from the File menu, and then select the new JAD file in the file browsing dialog window as shown above.

A complaint about previous versions of the WTK (and, frankly, other IDEs as well) was the fact that the IDE did not live up to J2ME API constraints. For example, both the Mobile 3D Graphics API and the Location API work on CLDC 1.1 and not CLDC 1.0. Both APIs cannot be used with CLDC 1.0 because of, for one, the need for floating point data types. In the WTK 2.2, a project can be configured to violate this specification constraint—much to the confusion of less experienced developers. For example, you canset up a project to use the Mobile 3D Graphics API and CLDC 1.0. The latest version of the WTK IDE prohibits the inclusion of APIs based on the version of CLDC selected as shown in Figure 3.

Figure 3. API Constraints: Note that certain APIs (Mobile 3D Graphics and Location APIs) cannot be included in the project when CLDC 1.0 (left image) is chosen over CLDC 1.1 (middle image). In the 2.2 version of the WTK 2.2, Mobile 3D Graphics is selected with CLDC 1.0 selected—a violation of the J2ME specifications.

These constraints are based on J2ME specifications and not device specifications. This means that certain configurations may not work when deployed to the device based on the specific implementation details. For example, Sun's own reference implementation of the Web Services API indicates it "should be used in combination with the CLDC 1.0.4 RI and the MIDP 2.0 RI." However, Sun's reference implementation suggestion can be violated in the new WTK. Many of the APIs supported by WTK are optional. Because they are optional, not all devices and J2ME implementations will include/use them. Obviously, the WTK cannot constrain the development environment for these types of implementation situations.

Another small but useful addition to the emulator is that you can now use your desktop's copy and paste utility to enter text into emulator text fields. This is a very helpful addition when repeatedly testing MIDlets.

The WTK release notes and Web site also indicate that additional improvements have been made to the MIDlet signing tools. I was unable to find the difference when compared to version 2.2, but may just have overlooked something obvious.

Thanks for your registration, follow us on our social networks to keep up-to-date