Hi
I have a Midlet which runs ok on emulator (with EasyEclipse) and doesn't start on N70.
Have you got an idea ?
this is the code for the main of the midlet :
package com.ode.air;
import java.io.IOException;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Image;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class AirOdeMidlet extends MIDlet implements CommandListener {
public static final boolean DEBUG = false;
/**
* The display
*/
Display display;
/**
* The Model object
*/
Deliveries deliveries;
/**
* All the commands for the application
*/
Command menuCommand = new Command("Menu", Command.OK, 1);
Command ajout_interCommand = new Command("Ajouter inter.", Command.ITEM, 1);
Command liste_inter_in_progressCommand = new Command(
"Liste inter. en cours", Command.ITEM, 2);
Command histo_interCommand = new Command("Histo. inter à 7j.",
Command.ITEM, 3);
Command parametresCommand = new Command("Paramètres", Command.ITEM, 4);
Command exitCommand = new Command("Sortie", Command.EXIT, 0);
/**
* All the screens of the application
*/
// WelcomeScreen welcomeScreen = new WelcomeScreen();
DownloadScreen downloadScreen = new DownloadScreen();
ListScreen listScreen = new ListScreen();
EditScreen editScreen = new EditScreen();
SettingsScreen settingScreen = new SettingsScreen();
ListeinterinprogressScreen liste_inter_in_progressScreen = new ListeinterinprogressScreen(this);
FirstScreen firstScreen = new FirstScreen(this);
public AirOdeMidlet() {
display = Display.getDisplay(this);
firstScreen.addCommand(ajout_interCommand);
firstScreen.addCommand(liste_inter_in_progressCommand);
firstScreen.addCommand(histo_interCommand);
firstScreen.addCommand(parametresCommand);
firstScreen.addCommand(exitCommand);
firstScreen.setCommandListener(this);
}
protected void startApp() throws MIDletStateChangeException {
// if (deliveries.hasData())
{
// display.setCurrent(listScreen);
}
// else
Displayable current = display.getCurrent();
if (current == null) {
// first time we've been called, get the logo image
Image logo = null;
try {
logo = Image.createImage("/images/logoODE.png");
} catch (IOException e) {
System.out.println("img bug="+e);
// // just use null image
}
Alert splashScreen = new Alert(null,
" ODE On The Air Welcome!",
logo, AlertType.INFO);
// Display the application’s first UI screen
splashScreen.setTimeout(5000); // 4 seconds
display.setCurrent(splashScreen, firstScreen);
} else {
// display.setCurrent(welcomeScreen);
}
// display.setCurrent(welcomeScreen);
}
// This firstScreen callback ends the application
public void firstScreenQuit() throws MIDletStateChangeException {
destroyApp(false);
notifyDestroyed();
}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void destroyApp(boolean arg0) {
// deliveries.close();
notifyDestroyed();
}
public void commandAction(Command c, Displayable d) {
if (c == liste_inter_in_progressCommand) {
display.setCurrent(liste_inter_in_progressScreen);
} else if (c == ajout_interCommand) {
} else if (c == histo_interCommand) {
} else if (c == parametresCommand) {
}
else if (c == exitCommand) {
destroyApp(true);
}
}
};
Thanks a lot
ERIC

Reply With Quote


