1

I'm desperate.

I'm developing an app in LWUIT, using the Resource editor. My project works fine in MIDP version, both in simulator and on devices. But when I find my issue when I start to test my app in Blackberry. The app works perfectly in the simulator but doesn't start in the devices. It doesn't give an error message, doesn't say anything. I try to change the UI_RIM.jar with the jars from LWUIT SVN or with the other jar generated from the Resource editor (UI_RIM_Touch.jar), but nothing changes. I don't know if the htttpConnections or FileConnections could be responsible of this issue. I have 2 Blackberry models, Torch and Bold. Does not work on either.

For developing this app, I'm using Netbeans and LWUIT 1.5

If you need to see some code, tell me what you want and I will post it

Thanks

EDIT

Sometimes, I start the app and 30/45 min after appears the next message "uncaught exception thrown in midlet constructor: userclasses.MainMIDlet". I don't know what is the problem.

mdelolmo
  • 6,417
  • 3
  • 40
  • 58
Mun0n
  • 4,438
  • 4
  • 28
  • 46

1 Answers1

1

RIM is hell to work with, I feel your pain... Codename One will help on that regard.

In general this sounds like one of the following:

  1. You created a MIDlet instead of a UiApplication. Make sure your class derives UiApplication and has a public static void main(String[] args) method which initializes the class. Also make sure that the class is public!

  2. During compilation you didn't define the application as a cldc application and left it as a MIDlet. We edited the build.xml in the resource editor generated files to invoke the proper version.

  3. You compiled with a JDE that is newer than the target device.

Check in the alt-lglg log to see if you have any errors or messages.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
  • Thanks for answer my question @ShaiAlmog. But still not working. I check step 1. I'm using the MIDlet generated by the Resource Editor, and It seems to be OK. In the 2 step, How can I define my app as cldc only? Modifying the build.xml? How?. Step 3: I'm compiling with the JDE 4.2.1. (I need Codename One!!!!!) ;-) – Mun0n Feb 02 '12 at 12:43
  • Are you using the MIDlet or the Blackberry application? The Resource Editor generates a blackberry specific application which should work as expected. If you are using 4.2.1 the code will only work on non-touch devices which have OS 4.2.1 and newer. – Shai Almog Feb 04 '12 at 10:22
  • I'm using the specific app that is given to me by the Resource editor, but it doesn't work. I'm compiling the app using 4.2 and install it in a BB Bold with OS newer JDE. – Mun0n Feb 06 '12 at 16:48
  • If you get the uncaught exception error then your MIDlet is failing with an exception. Finding out why is the true pain and the difference between RIM's implementation and everything else is a huge source of pain. Wrap everything in try catches, log every exception (printStackTrace allows you to see the "stack" in the device log) and make sure that if you have class member fields that they are initialized within the constructor and not in the class e.g. instead of defining a Button b = new Button(); define it as Button b; and initialize later otherwise you can't catch an exception if it fails. – Shai Almog Feb 10 '12 at 05:37
  • I tried to do that. But the exception must be inside the StateMachineBase, I think. I try to change the IO and UI given by the Resource Editor and put IO_RIM and UI_RIM from the LWUIT trunk, but I get no improvement. I don't understand why it works in the simulator and doesn't work in the device. I haven't more ideas – Mun0n Feb 15 '12 at 09:02
  • You can wrap the statemachine base with try/catches and it will stay the same as long as you don't save your project in the resource editor. You should be able to catch an exception that is triggered there. If it fails within the state machine base its possible that the resource file isn't found where it should be. – Shai Almog Feb 16 '12 at 06:15