Question

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{

  private 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?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top