×

Discussion Board

Results 1 to 2 of 2

Thread: 6600 quirks

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    4

    6600 quirks

    Howdy all

    I’m in the process of developing a few small Series 60 games with my target/test phones being the 3650, the 6600, and the N-Gage. All the games work on the emulator, the 3650 and the N-Gage, but won’t start on the 6600. It downloads just fine and the jar is correct, but it’s like the phone can’t find or doesn’t get to the MIDlet’s constructor and/or the startApp call. I’ve had this problem before with this phone, but it was because I had A: assets (.png files) named with capital letters and B: functions in my classes called “init()”, but I’m not doing either of those this time around. Below are some code snippets of how I’m setting these games up.

    public class Game extends MIDlet implements Runnable
    {

    private boolean running;
    private myCanvas screen;

    ...

    public Game()
    {
    screen = new myCanvas(this);

    if (screen != null)
    Display.getDisplay(this).setCurrent(screen);
    }

    protected final void startApp() throws MIDletStateChangeException
    {
    running = true;
    new Thread(this).start();
    }



    public final void run()
    {
    try
    {
    while (running)
    {

    if (screen != null)
    {
    screen.repaint();
    screen.serviceRepaints();
    }

    … // sleep
    }


    }
    catch (Exception ex)
    {

    }
    }
    }

    public class myCanvas extends FullCanvas
    {


    public myCanvas(Game)
    {

    }



    protected abstract void draw(Graphics);

    protected final void paint(Graphics)
    {

    }
    }

    Note that Display.getDisplay(this).setCurrent(screen) is not the same as the Display.setCurrent(Alert, Displayable) call mentioned in the known issues document. After playing around with this quite a bit, I found a very bad bandaid/hack/fix that gets a couple of my games (but not all) working on the 6600. I created a class that extends myCanvas (which is extended from FullCanvas) with nothing but a blank constructor inside like so:

    public class Temp extends myCanvas
    {
    public Temp() {}
    }

    I then added an else to the if statement in the MIDlet constructor that instances this useless class like so:

    public Game()
    {
    screen = new myCanvas(this);

    if (screen != null)
    Display.getDisplay(this).setCurrent(screen);
    else
    screen = new Temp();
    }

    Why this does works, I have no idea, because if Temp were in fact instanced, then nothing would happen from then on. If you have any ideas or know of anymore undocumented 6600 bugs, or where I can find more information on the 6600, please let me know.

    BTW, here’s a list of the software I’m using to do all this fun stuff.

    J2SDK 1.4.2_06
    Eclipse 3.0 w/ the EclipseME & Perforce plugins
    Perforce 2004.2
    Sun’s WTK 2.2 w/ Series_60_MIDP_Concept_SDK_Beta_0_3_1_Nokia_edition

    Building with an XML script using
    Ant 1.6.2
    Ant Antenna 0.9.13
    Proguard 3.1
    And setup for MIDP 1.0 and CLDC 1.0

    Thanks a bunch.

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Setting the current displayable before startApp() is called has caused me problems on many phones, because apparently on some systems when the MIDlet constructor is called not everything has been initialized properly. Try moving that part to the startApp() method.

    shmoove

Posting Permissions

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