Reference: http://adhocstart.wordpress.com/2009/06/02/j2me_1/
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;public class HelloWorld extends MIDlet implements CommandListener {
private Command exitCommand;
private TextBox tbox;
public HelloWorld() {
exitCommand = new Command(�Exit�, Command.EXIT, 1);
tbox = new TextBox(�Hello world MIDlet�, �Hello World!�, 25, 0);
tbox.addCommand(exitCommand);
tbox.setCommandListener(this);
}
protected void startApp() {
Display.getDisplay(this).setCurrent(tbox);
}
protected void pauseApp() {}
protected void destroyApp(boolean bool) {}
public void commandAction(Command cmd, Displayable disp) {
if (cmd == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
}
I followed the instructions and the Emulator thing showed "Hello World".
when i got the .jad and .jar files from C:\EclipseWorkspace\HelloWorld\.eclipseme.tmp\emulation
and ran the .jad, the phone tells me that the .jar file is invalid.
in addition how do i build the .jar from Eclipse using Java ME, instead of having it in the tmp folder?