You Are Here:

Community: Developer Discussion Boards

#1 Old 6600 quirks - 2004-12-08, 20:43

Join Date: Dec 2004
Posts: 4
bltj2me
Offline
Registered User
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.
Reply With Quote

#2 Old 2004-12-09, 09:19

Join Date: Mar 2003
Posts: 2,280
Location: Israel
shmoove
Offline
Forum Nokia Champion
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
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ