Hi@all,
I've some problemlos to run my simple java application on my Nokia 6630 mobile phone.
I created the following application:
--- Begin Code test.java ---
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class test extends MIDlet implements CommandListener {
private Display display;
private Form form;
private TextField world;
private Command cmdClose;
public test() {
display = Display.getDisplay(this);
form = new Form("Test Program");
world = new TextField("Field: ", "Hello World!", 3, TextField.ANY);
cmdClose = new Command("Close", Command.EXIT, 1);
form.append(world);
form.addCommand(cmdClose);
form.setCommandListener(this);
}
public void startApp() throws MIDletStateChangeException {
display.setCurrent(form);
}
public void pauseApp() {
}
public void destroyApp(boolean flag) {
}
public void commandAction(Command command, Displayable displayable) {
destroyApp(false);
notifyDestroyed();
}
}
--- End Code ---
Then I created the following manifest file:
--- Begin Code MANIFEST.MF ---
Manifest-Version: 1.0
MIDlet-Name: Test Program
MIDlet-1: test
MIDlet-Version: 1.0
MIDlet-Vendor: Kay
Created-By: 1.3.0 (Sun Microsystems Inc.)
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-1.0
--- End Code ---
I compiled this source code and packed the compiled .class file with the following commands:
javac -classpath C:\Programme\WTK104\lib\midpapi.zip test.java
jar cvfm test.jar MANIFEST.MF test.class
The test.class and the test.jar files were created without any errors.
Then I copied the test.jar file via USB-Cable (Nokia PC Suite software) to the install directory of my mobile phone. I selected the received file on my phone and opened it - the install process was started. After the successful installation, a new program icon was placed in the phone menu.
If I start the test program now, nothing happens. The program doesn't run (the program window isn't shown) and there are no error messages. Only the phone menu is shown again.
Where is the error? What I did wrong?
Thanks4help,
Kay

Reply With Quote

