Getting started with LWUIT using Nokia IDE for Java ME (Eclipse)

System requirements

Any relatively recent version of Windows should work. These instructions have been tested on 64-bit Windows 7 Enterprise.

Install and configure Java ME development tools

The same prerequisites apply as with ordinary Java ME development on Nokia devices. You can use Nokia IDE for Java ME (Eclipse) (with Mobile Tools for Java) and Nokia Java SDKs as usual.

If you don't have a functional development environment, follow the instructions in this guide: ​Getting started with the Nokia IDE for Java ME.

Install and configure ProGuard

To use ProGuard for preverification and/or obfuscation, perform the following steps:

  1. Download a ProGuard release from Sourceforge.

  2. Extract the package to a location of your choice.

  3. In Nokia IDE for Java ME (Eclipse), from the Window menu, select Preferences. The Preferences window is displayed.

  4. Under the Java ME section, configure the extracted package directory as the ProGuard Root Directory.

Considerations when working with hierarchical projects in Eclipse

Traditionally LWUIT development has taken place using NetBeans. This is reflected, for example, by the resource editor generating NetBeans projects from UIs created with the UI builder, where a hierarchical structure of parent projects and platform projects is generated. This structure does not work in Nokia IDE for Java ME (Eclipse), because Eclipse project directories have to be first-level children of the workspace directory, and the workspace directory itself cannot be a project. Say we have a structure like this:

ProjectsDir
|
+--- ParentProject
       |
       +--- PlatformProject1
       |
       +--- PlatformProject2

Now, to create an Eclipse project from the parent project, you have to set 'ProjectsDir' as the workspace. Then, to create Eclipse projects from the platform projects, you have to to set 'ParentProject' as the workspace. However, while 'ParentProject' is the workspace, 'ParentProject' cannot be imported as a project, and therefore cannot be set as a dependency of any platform project.

The best solution to this is to either:

  1. Refrain from creating nested project structures (this approach used in the example project of this tutorial), or

  2. Create a single new Eclipse project and link *both* the parent and the platform-specific source directories to it.

Creating a LWUIT application using Nokia IDE for Java ME (Eclipse)

The following topics describe how to create a simple LWUIT application using Nokia IDE for Java ME (Eclipse).