0

I have a LWUIT-application which I also want to run on Blackberry phones. For this I use the approach from the LWUIT Demo App - common implementation is placed in a separate project (the base), there is 1 more separate project for MIDP which depends on the base, 1 other for RIM which also deps on the base. The project for RIM produces a native RIM application. In RIM's world it's called CLDC app or RIMlet. So, my application is not derived from MIDlet, but from UiApplication. See below.

import net.rim.device.api.ui.UiApplication;

public class MyRimlet extends UiApplication implements Runnable {

Now the problem...
I use some library. The class from that library needs lcdui's Display for its initialization (ref2 javax.microedition.lcdui.Display). I can get a ref2 Display if I have MIDlet. For this I can use Display.getDisplay(MIDlet m) method. But I don't have MIDlet since my app is derived from UiApplication.
So, what should I do to initialize the class from external lib?

Please help me regarding this.

Lucifer
  • 29,392
  • 25
  • 90
  • 143
Zakhar
  • 2,143
  • 2
  • 15
  • 15
  • Check `net.rim.device.api.system.Display`, http://www.blackberry.com/developers/docs/4.3.0api/net/rim/device/api/system/Display.html – Rupak Jan 17 '12 at 09:01
  • That interface is different and it doesn't provide lcdui's Display interface. – Zakhar Jan 25 '12 at 12:04

1 Answers1

1

In general, you cannot mix LWUIT components with J2ME components, as far as I know. My knowledge could be dated though. But I have used the approach provided here successfully earlier.

However, I must mention that it is possible to develop UI components that can work on both J2ME as well as Blackberry by making use of BlackberryCanvas. I am almost sure LWUIT is doing something similar.

Using the Widgets apart, the way you start the application would be different. You will have to create a CLDC application on Blackberry; you cannot use MIDlet.

Kiran Kuppa
  • 1,457
  • 10
  • 18