Advanced - Creating Profiles and Platform Definitions

EclipseME provides the ability to define new platform definitions beyond the standard J2ME definitions. For example, the Nokia 3650 is a MIDP 1.0 device that also provides wireless messaging and multimedia API's that are not part of the MIDP 1.0 specification. By creating a new platform definition, an EclipseME developer can easily create new Midlet Suite projects that contain the appropriate libraries. In addition, support for packaging a deploying these projects will take the platform definition into account when verifying classes and building the JAD and JAR files.

In this example, Sun's Beta 2.1 Wireless Toolkit will be used to create the platform definition representing a Nokia 3650.

Step 1: Add Wireless Toolkit

The first step is to ensure that the wireless toolkit that will be used to create the profile is installed. In order to install a new wireless toolkit, right-click on Wireless Toolkits in the Platform Components view and choose Add Wireless Toolkit. Select the wireless toolkit's root directory and press Finish.

screenshot

Sun's Wireless Toolkit Version 2.1 provides multiple CLDC and MIDP options as you can see from the platform components.

screenshot

Step 2: Add Profile

MIDP profiles provide a set of libraries to the device that may be used to when building MIDP midlets. The Nokia 3650 provides multimedia and wireless messaging support via extensions to the MIDP 1.0 standard profile. In this step, a new 3650-specific profile will be created to provide these libraries to midlets being developed.

Start by right-clicking on Profiles and choosing Add MIDP Profile. The new MIDP profile wizard will be opened.

screenshot

On the first page, select the appropriate wireless toolkit that you will use as a base for the new profile, and provide a descriptive name for the profile. In this case, choose the "J2ME Wireless Toolkit 2.1" and use "Nokia 3650 Libraries" as the name. Once completed, select the Next button to advance the wizard.

screenshot

The next page in the wizard provides a place to add libraries that are not part of the default profile. This page is similar to the standard Eclipse build path support. In our case, we want to add the libraries for MMAPI and Wireless Messaging. For portability, the best way to do this is to use the Classpath Variables that were created when the toolkit was installed. Using a classpath variable ensures that the library definition is portable to other machines or installations.

Press the Add Variable... button. This will display the New Variable Classpath Entry dialog.

screenshot

On this dialog, select WTK21 - the variable for the Sun toolkit, then press the Extend button in order to select an item relative to the directory specified by this variable.

screenshot

Expand the lib directory and select the mmapi.jar item and press OK. This will add this JAR file to the profile. Repeat the process to add the wma.jar file.

At this point, the dialog should look like this:

screenshot

When the profile libraries are specified, press Finish to create the new profile.

Step 3: Add Platform Definition

The last step is to define the Platform Definition. An EclipseME Platform Definition is the component that pulls all of the other components together. A platform definition consists of the wireless toolkit, configuration and profiles for an specified device.

Start by right-clicking on Platform Definitions in the Platform Components view and selecting Add Platform Definition. The new platform definition wizard will be opened.

screenshot

On the first page, select the appropriate wireless toolkit, the platform definition on which the new platform definition is based and provide a descriptive name for the platform definition. In this case, choose the J2ME Wireless Toolkit 2.1, the Wireless Tookit 2.1 MIDP 1.0 Platform Definition and use "Nokia 3650" as the name. Once completed, select the Next button to advance the wizard.

screenshot

The next page of the wizard provides a location to select the configuration and set of profiles that make up this profile. Select the components as shown for the Nokia 3650 device. When the components are selected, press Finish to create the new platform definition.

At this point the new Nokia 3650 platform can be used when creating a new midlet suite project. For more information see Create a new J2ME Midlet project.