You Are Here:

Community: Developer Discussion Boards

#1 Old how to debug J2ME program which freezes - 2003-02-08, 07:16

Join Date: Mar 2003
Posts: 47
shahzad73
Offline
Registered User
Hi

I have absolutely no idea how to degug and catch this error.. the program frrezes at some time. my program is using one thread which perform different works like refreshing the game screen, updating different characters positions and other things.... Also using some sounds in the program....

also when program freezes i can access the Options menu but don't know does the buttons on that work.

it seems to me that the thread stops executing.

can some body tell me how to check the status of a threrad is it working or halt some point and then i quit that thread and start it executing again. like it refresh screen thread halts then i can quit that thread and start executing it again..

there is some point in thread that it halts and i can not catch it where it is causing the problem. can some body tell me how to debug and atleast know where it halts in the program.


i am using Sun ONE Studio 4 ME + Nokia J2ME SDK + Series 60 SDK and testing the program in Series 60 emulator.

here is how i am creating the thread


frameTimer = new Timer();
frameTimer.schedule(new AnimationTask(), 1,31);


and here is the impelementation


class AnimationTask extends TimerTask {
public AnimationTask() {
}

public void run()
{
screen.update();
screen.fightUpdate();
screen.repaint();
}

}

screen is a Canvas object.

See it performs some functions and the program halts some where in those functions



Pls pls tell me what to do with this not it is draging me a lot and the problem is i even don't know what is causing it.



Shahzad
Reply With Quote

#2 Old catch the exception - 2003-04-29, 16:21

Join Date: Apr 2003
Posts: 7
gs1284
Offline
Registered User
Hi,

most likely an exception has been thrown in your run method.
So you should catch the Exception, Error or throwable.

Then simply let the thread coninue running but now it will only print the error message to your screen.

so when you call repaint in your thread, the paint method knows the error message and will paint the e.getMessage() or so to your screen.

siebe
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