Boa tarde Amigos
Eu transferi um aplicativo.JAD pelo cabo USB para o celular, porem quando eu executo o aplicativo no celular da o seguinte Erro:
Tipo de Arquivo não Suportado
O celular é um Sansung GT-S3650
Alguem sabe me informar qual seria o problema, sera que seria alguma configuração no celular?
Segue o fonte abaixo:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
* @author Usuario
*/
public class Hello1 extends MIDlet implements CommandListener{
private boolean midletPaused = false;
private Command cmCall = new Command("Call", Command.SCREEN, 1);
private Form form;
private Display display;
private TextField tf1;
private Command comandoDeSaida;
//<editor-fold defaultstate="collapsed" desc=" Generated Fields ">
//</editor-fold>
/**
* The Hello1 constructor.
*/
public Hello1()
{
display = Display.getDisplay(this);
form = new Form("Form 1");
comandoDeSaida = new Command("Exit", Command.SCREEN,1);
tf1 = new TextField("text1", "text2", 15, TextField.ANY);
form.addCommand(comandoDeSaida);
form.addCommand(cmCall);
form.append(tf1);
form.setCommandListener(this);
}
//<editor-fold defaultstate="collapsed" desc=" Generated Fields ">
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Methods ">
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">
/**
* Initilizes the application.
* It is called only once when the MIDlet is started. The method is called before the <code>startMIDlet</code> method.
*/
private void initialize() {
// write pre-initialize user code here
// write post-initialize user code here
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">
/**
* Performs an action assigned to the Mobile Device - MIDlet Started point.
*/
public void startMIDlet() {
// write pre-action user code here
// write post-action user code here
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">
/**
* Performs an action assigned to the Mobile Device - MIDlet Resumed point.
*/
public void resumeMIDlet() {
// write pre-action user code here
// write post-action user code here
}
//</editor-fold>
//<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">
/**
* Switches a current displayable in a display. The <code>display</code> instance is taken from <code>getDisplay</code> method. This method is used by all actions in the design for switching displayable.
* @param alert the Alert which is temporarily set to the display; if <code>null</code>, then <code>nextDisplayable</code> is set immediately
* @param nextDisplayable the Displayable to be set
*/
public void switchDisplayable(Alert alert, Displayable nextDisplayable) {
// write pre-switch user code here
Display display = getDisplay();
if (alert == null) {
display.setCurrent(nextDisplayable);
} else {
display.setCurrent(alert, nextDisplayable);
}
// write post-switch user code here
}
//</editor-fold>
/**
* Returns a display instance.
* @return the display instance.
*/
public Display getDisplay () {
return Display.getDisplay(this);
}
/**
* Exits MIDlet.
*/
public void exitMIDlet() {
switchDisplayable (null, null);
destroyApp(true);
notifyDestroyed();
}
/**
* Called when MIDlet is started.
* Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
*/
public void startApp() {
if (midletPaused) {
resumeMIDlet ();
} else {
initialize ();
startMIDlet ();
}
midletPaused = false;
}
/**
* Called when MIDlet is paused.
*/
public void pauseApp() {
midletPaused = true;
}
/**
* Called to signal the MIDlet to terminate.
* @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.
*/
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command comando, Displayable display) {
if(comando == comandoDeSaida)
{
destroyApp(false);
notifyDestroyed();
}
if(comando == cmCall)
{
Alert a = new Alert("Mensagem de alerta", "Hello Java " , null, null);
a.setTimeout(2000);
showScreen(a);
}
}
public void showScreen(Displayable disp)
{
Display.getDisplay(this).setCurrent(disp);
}
}