Jump to content
  • Advertisement
Sign in to follow this  
Moose6912

MIDP 1.0 and Sony Ericsson emulator

This topic is 5473 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've a simple game demo created using MIDP 1.0 . It runs perfectly fine on my nokia S40 emulator and phone.But when i try to run it on the Sony Ericsson T610 emulator,i've encountered the following error message "App exception: java.lang.NullPointerException java.lang.NullPointerException at GameScreen.GameCycle(+80) at GameScreen.run(+36) " I don't see how the NullPointerException can occur since the methods GameCycle and run are declared and the midlet runs perfectly fine on my Nokia S40 emulator and i've declared the thread using Thread t = new Thread(this); t.start();

Share this post


Link to post
Share on other sites
Advertisement
Recompile the midlet with line numbers turned on, then you should see what line it fails at (Assuming that preverify or something doesn't chomp them).

I imagine it's something like a race condition - something that you're expecting to be non-null, is not.

Your code should be resilient against things happening in a different order from what you expect, particularly if you use threads.

Also the SE emulator is pretty rubbish - I normally use Microemulator with a SonyEricsson skin instead because it's more like a phone (believe it or not) - even though it doesn't support the SE specific APIs

Mark

Share this post


Link to post
Share on other sites
I've managed to find the bug.I had a few objects explicitly set to null and that caused the stupid bug.Funny thing was that those lines of code didn't cause any problem when running in the s40 emulator.

Share this post


Link to post
Share on other sites
Be sure to review your S40 code then. And make sure the problem is fixed in the S40... even if it runs properly.
Leaving this may lead to memory leaks or other unforseen problems.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!