×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    1

    my MIDP game can't run on real phone

    I am writting a game in MIDP, and I found it can't be run on real phone (6600) the code of canvas is posted below:

    class AnimeCanvas extends Canvas implements Runnable, CommandListener {

    private boolean isStopped;
    private AnimeMIDlet midlet;
    private Display display;
    private Thread thread;

    private volatile boolean aborting = false;

    private Animation animation;
    private final static int SCREENWIDTH = 128;
    private final static int SCREENHEIGHT = 128;

    //Bg Setup
    private byte selBg = 0;

    //new add
    private GameImage maskImg;
    private GameImage logoImg;
    private GameImage panelMsgBoxImg;
    private GameImage panelFaceImg;
    private Image bgImg;
    private Button[] button;
    // private GameImage
    //GAMESTATE DEFINATION
    final short IDLE = 0;
    final short GAMETITLE = 1;
    (SKIP)
    public final short GAMEOVER = 10;

    //GAMESTATE DEFINATION END

    public Panel panel;
    public Panel Panel2;
    public Panel gamblePanel;

    //COMMAND DEFINATION
    public Command startCommand;
    public Command quitCommand;
    public Command titleCommand;
    public Command optionCommand;
    public Command entryCommand;
    public Command pauseCommand;

    public List optionList;
    //COMMAND DEFINATION END
    private int gameState;
    RollingScreen rollingScreen;
    Image rollingImg;
    public static final void SETCLIP(Graphics g, short xPos, short yPos, short width, short height)
    {
    (SKIP)
    }//End of Static Function


    AnimeCanvas(AnimeMIDlet midlet, Display display) {
    this.midlet = midlet;
    this.display = display;
    initTitle();
    setCommandListener(this);
    thread = new Thread(this);
    thread.start(); // initially just waits for a notification
    }
    public void run() {

    while(! aborting) {
    try {
    update();
    repaint();
    Thread.sleep(100);
    }
    }catch(InterruptedException e){}
    }
    }


    //UI Control
    public void commandAction(Command c, Displayable d)
    {
    (SKIP)
    }

    protected void keyPressed(int keyCode)
    {
    int gameAction = getGameAction(keyCode);
    switch (this.gameState)
    {
    case OPTION_BG:
    (SKIP)
    break;
    }
    }


    //UI Control END


    //Init Mode END

    protected void paint(Graphics g) {
    switch (gameState)
    {
    case GAMETITLE:
    (SKIP)
    break;
    case OPTION:


    break;
    case OPTION_BG:
    (SKIP)
    break;
    case IDLE:
    break;
    }


    }

    //Thread Flow Start
    private void update()
    {
    switch(gameState)
    {
    case GAMETITLE:
    (SKIP)
    break;
    case SELECTION:
    (SKIP)
    break;
    }

    break;
    }
    }

    private void quitAction()
    {
    midlet.quit();
    }



    public void quit()
    {
    aborting = true;
    synchronized (this)
    {
    notify(); // wake up our animation thread and kill it
    }
    }
    //Thread Flow End
    }

    Please help me out , and tell me any possible reason for a jar can run on emulator but not in real phone

  2. #2
    Registered User
    Join Date
    Apr 2005
    Posts
    6
    I am having the same problem, could you please post the solution here if you find any....

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×