开发者

Java ME deploying midlet

I'm writing a Java ME Midlet for a Nokia N82, I want to just count down from 30 and restart when it reaches 0. Whenever i move the .jar and .jad file and try to run them from the mobile phone it will say that it can't install the midlet or that the application is not compatible with the phone. The code i have is:

import java.util.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

public class myMidlet extends MIDlet implements CommandListener{

  pri开发者_如何学Cvate Form form;
  private Display display;
  private int tt;
  private int ttinc;
  private Timer tm;

  public myMidlet(){
      ttinc=30;
      tt=-1;
      tm=new Timer();
  }

  public void startApp(){
    showInput();
  }

  public void pauseApp(){}

  public void destroyApp(boolean destroy){
    notifyDestroyed();
  }

  public void showInput(){
    display = Display.getDisplay(this);
    Form form = new Form("GPS");
    if(tt<0){
        form.append("Sending update...");
    }else{
        form.append("Sending update in "+tt+" seconds.");
        tt--;
    }
    tm.schedule(new TodoTask(), 1000);

    display.setCurrent(form);
  }

  public void commandAction(Command c, Displayable d) {}

  public class TodoTask extends TimerTask{
     public final void run(){
        showInput();
     }
  }
}

What can i do/try to get this working?


It seems you have made a build that is not compatible to phone.

make sure you set MIDP 2.0 ,CLDC 1.1 and then build this conf. is mostly supported in every phone. and make it relevant to your N82

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜