My solution is just using NetBeans and BlackBerry JDE, it is much easier to build a demo.
Here is the step by step description:
Build LWUIT BlackBerry library
1. Checkout the LWUIT source code from SVN, (https://lwuit.dev.java.net/svn/lwuit/trunk), the LWUIT source includes the NetBeans BlackBerry port project.
2. Install JDE 4.7 and Configure BlackBerry support in NetBeans, you can follow this link to configure;
3. Start NetBeans, open the "BlackBerryPort" poject under the "BlackBerry" sub folder of lwuit project source, there are two configuration for this project, the default is for non touch screen build, the "touch" configuration is for touch screen device like STORM.for non touch device, just choose DefaultConfiguration, build the project, you will see BlackberryPort.jad and BlackberryPort.jar in \dist folder, they are the LWUIT library for BlackBerry devices;
Build LWUIT Demo into BlackBerry CLDC application
1. Open Blackberry JDE, create a new workspace, called "lwuitdemo.jdw";
2. add a new project under the workspace, name it "lwuit", choose its Application type as "Library", import the BlackberryPort.jad and BlackBerryPort.jar file into the project. then build it, the JDE will generate lwuit.cod and update BlackBerryPort.jad file.
3. download LWUIT 1.3 from sun website, it comes with the famous LWUITDemo source code, open the LWUITDemo project using NetBeans, build it;
4. add another new project in the JDE workspace, name it "lwuitdemo", choose application type as "CLDC Application";
set up the correct value with title, version and Vendor information;
next you need to add project dependency to "lwuit" project, right click project, choose "Project Dependencies..", choose "lwuit project";
copy all the java source code from LWUITDemo src folder, add them into the project, ignore those png files and .res files;
go to build\preverified folder, copy all the png files and .res files, add them into your JDE project;
right click icon.png, choose "use as application icon";
5.Modify the UIDemoMIDlet.java
Made following changes:
make sure the UIDemoMIDlet extends from uiApplication, like this:
public class UIDemoMIDlet extends net.rim.device.api.ui.UiApplication {...}Add the following methods, copied from Shai's blog:
public static void main(String[] argv) { new UIDemoMIDlet().startApp(); } public void notifyDestroyed() { System.exit(0); } public void platformRequest(String s) { net.rim.blackberry.api.browser.Browser.getDefaultSession().displayPage(s); }In startApp() method, comment out the following statement, because non touch device need to disable the virtual keypad:
// VKBImplementationFactory.init();6. Build the lwuitdemo project.
7. Sign both lwuitdemo.cod and lwuit.cod fle, load them both into your blackberry device.
8. If you want to provide OTA download, that is a litttle bit tricky:
You need to download two artifacts, one for lwuit libray, the other for lwuitdemo, which means user need to download two links:
1) lwuti library:
BlackBerryPort.jad
lwuit.cod
lwuit-1.cod
...
2) lwuitdemo application:
lwuitdemo.jad
lwuitdemo.cod
lwuitdemo-1.cod
...
You can download the whole source code of the JDE project from here.
In future I would like to share:
1. Provide an updated build.xml based on Shai's blog;
2. provide how to build LWUITDemo MIDlet project for BlackBerry device.