Please, look this:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class sample extends MIDlet implements CommandListener {
private Form frmMain = new Form ("Main Form");
private Command cmdExit = new Command("Exit",Command.EXIT,1);
private Display display;
public sample()
{
display = Display.getDisplay(this);
}
public void startApp()
{
frmMain.addCommand (cmdExit);
frmMain.setCommandListener(this);
display.setCurrent (frmMain);
}
public void pauseApp() { }
public void destroyApp(boolean unconditional) {}
public void commandAction(Command c, Displayable d)
{
if (c==cmdExit)
{
destroyApp(true);
notifyDestroyed();
}
}
}
I use WTK Version 2.1 to compile project (Settings->Profiles: MIDP 1.0, Configurations: CLDC 1.0 )
I load only *.jar on my Phone and... "Application Error".
BUT Project "games" (from WTK) run without errors (on my Phone).
jad:
MIDlet-1: sample, sample.png, sample
MIDlet-Jar-Size: 1158
MIDlet-Jar-URL: sample.jar
MIDlet-Name: sample
MIDlet-Vendor: Unknown
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-1.0
P.S. I did't know about difference between "sample" and "Sample"... Thank you!