I was able to install a J2ME app consisting of a jar and jad file into my mobile. But it terminates as soon as it is launched. I am not able to see if it actually prints Hello World.
HelloWorld.java
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class HelloWorld
extends MIDlet
implements CommandListener {
private Form mMainForm;
public HelloWorld() {
mMainForm = new Form("HelloWorld");
mMainForm.append(new StringItem(null, "Hello, MIDP!"));
mMainForm.addCommand(new Command("Exit", Command.EXIT, 0));
mMainForm.setCommandListener(this);
}
public void startApp() {
Display.getDisplay(this).setCurrent(mMainForm);
}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command c, Displayable s) {
notifyDestroyed();
}
}
Manifest.mf
Manifest-Version: 1.0 MIDlet-Name: HelloWorld MIDlet-1: HelloWorld, , HelloWorld MIDlet-Vendor: Ankit Gupta MIDlet-Version: 1.0.0 MIDlet-Description: HW MIDlet-Info-URL: http://google.com MicroEdition-Profile: MIDP-2.0 MicroEdition-Configuration: CLDC-1.0 HelloWorld.jad ---------------------------- MIDlet-1: HelloWorld, , HelloWorld MIDlet-Name: HelloWorld MIDlet-Version: 1.0.0 MIDlet-Vendor: Ankit Gupta MIDlet-Jar-URL: HelloWorld.jar MIDlet-Jar-Size: 1212 MicroEdition-Profile: MIDP-2.0 MicroEdition-Configuration: CLDC-1.0
mMainForminitialization from constructor into startApp - per my recollection this way would be more reliable - gnat