Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » DSDP - Mobile Tools for Java (MTJ) » MMAPI: Moto Q8 emulator fails
MMAPI: Moto Q8 emulator fails [message #570651] Tue, 13 January 2009 20:46
Eclipse UserFriend
Originally posted by: news.s237965939.online.de

I'm working on a program which makes use of Midi playback. Now I
encountered an odd problem. Just by random i picked up the Moto Q8
emulator. My program successfuly runs on all other emulators I've tried.
So I tracked te problem down to the simplest possible example to show
the problem. The crash happens in the constructor of the canvas class.
Since it works on all other emulators I've checked, I ask myself what's
wrong with my code or what's wrong with the Moto Q8? I'm really clueless
here.

TIA,
Hans

================ TestQ8MIDlet.java, TOP OF FILE =================
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class TestQ8MIDlet extends MIDlet {
canvasQ8 cv;

public TestQ8MIDlet() {
cv = new canvasQ8();
}

protected void destroyApp(boolean arg0) throws
MIDletStateChangeException { }
protected void pauseApp() { }
protected void startApp() throws MIDletStateChangeException { }
}
=================== TestQ8MIDlet.java, BOTTOM OF FILE ===============

=================== canvasQ8.java, TOP OF FILE =================
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;
import javax.microedition.media.Player;
import javax.microedition.media.PlayerListener;

public class canvasQ8 extends Canvas {
public class EventHandler implements PlayerListener {
public void playerUpdate(Player player, String event, Object
eventData) {
if (event == PlayerListener.END_OF_MEDIA) {
player.deallocate();
}
}
}
EventHandler myEventHandler;

public canvasQ8() {
// this line causes te crash
myEventHandler = new EventHandler();
}

protected void paint(Graphics arg0) { }
}
=================== canvasQ8.java, BOTTOM OF FILE =================
Previous Topic:startApp threw an Exception
Next Topic:[mtj 0.9.1+Eclipse 3.4.l+WTK 2.5.2]mtj console output garbage character
Goto Forum:
  


Current Time: Thu Mar 28 13:07:54 GMT 2024

Powered by FUDForum. Page generated in 0.02666 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top