Java ME application runs fine in emulator but fails when deployed to N70. Any way to determine the cause of the failure?

I have developed a Java ME application for the CLDC platform. It works great when executed in an emulator. But when I bring it to my N70 phone, the app doesn't launch at all on the phone. There are about 14 classes in my application and I instantiate each one and put them in a vector when the application starts. Classes only have one variable and 2 methods. Could this create a multitude of cases to be the cause of his crash?

Is there a way to find out why the app can't start on the phone?

Update: Its working fine on the emulator. And one more thing I would like to mention is that the code only stops executing at the point where I create these 14 instances and add them to the vector. Up to this point, the code runs fine.

+2
java-me cldc midp


a source to share


4 answers


It may depend on where in the code you create these instances. If you create them in your MIDlet constructor or startApp method, try moving initialization to your application's startup method.



One way to debug J2ME applications that won't run on the phone is to add "printf" style debug messages in your code to be written to the record storage system, and add another MIDlet to the application to read from RMS and display those messages. Or you can just comment out the bits of the code and see if it works.

+3


a source to share


You can debug the device. If the emulator you are using is part of the Nokia SDK, then there should be tools elsewhere for testing and debugging on the device. (I would post more details on this, but only recently did this with Sony Ericsson phones.)



Another option is to use Nokia's tools , which allow you to view the standard output and error for your application while it is running on yours (for example, via Bluetooth).

+2


a source to share


The likelihood that your application will actually destroy the Java Virtual Machine bytecode interpreter stream and terminate its entire process is very small.

This has happened before, but you need to troubleshoot several other potential issues before you can verify the actual failure.

It is more likely that either:

  • Your MIDlet is not built or is not running because the MIDP runtime thinks it is wrong.
    or
  • Your midlet is just throwing an exception that you won't catch, which can lead to it being aborted.

Since the MIDlet installer is supposed to prevent you from installing a bad MIDlet, an uncaught exception problem is more likely to occur.

How to find an uncaught exception:

  • Start with the simplest HelloWorld MIDlet using Form

    so you can easily insert more StringItem

    at the top of your screen.
  • Build and run a new one Thread

    inMIDlet.startApp()

  • In your override Thread.run()

    add a block try{}catch(Throwable){}

    .
  • Within this block, do what your original MIDlet did.
  • Use the form as standard output for debugging.

You can use form registration to make sure you don't enter an infinite loop, to display exception classes and messages, to indicate logical milestones, to display variable values ​​...

This is the first step to figuring out what's going on.

+2


a source to share


I also faced a similar problem and when I recompiled my MIDLET as Midlet 1.0 then it worked fine. It seems that the N70 cannot run the new version of MIDLET. I think you are downgrading and re-checking your midlet.

Hello

Junaida

0


a source to share







All Articles