Click to See Complete Forum and Search --> : [RESOLVED] J2ME Error


girish_mu
December 24th, 2008, 08:29 AM
Hello! I'm currently testing an MMAPI Example from Nokia which involves the camera. What the example does is simply to use the camera and then take a picture. However, when I compile and run the example I get a message on the emulator telling me: "Camera wants to record snapshot image", "Is it OK to record?". When I press "Yes", nothing seems to happen. How do I get rid of it?

Moreover, when I send the JAR file that has been built to my SE S700 or SE K500, I get an error message saying: "Downloading Failed". Why is it so? Is it because the file is too tiny (~5 kb only)??

I'm attaching the code. It can be opened directly into NetBeans.

Help would be much appreciated. Thank You!

girish_mu
December 25th, 2008, 12:04 AM
I've managed to make it work. I had to use a different thread for the Capture part. Here is the piece of code that has been modified:

class stopRecord extends Thread {
public void run() {
if(player!=null){
try{
byte[] pngImage=videoControl.getSnapshot(null);
midlet.cameraCanvasCaptured(pngImage);
}catch(MediaException me){
message1="MediaException:";
message2=me.getMessage();
}
}
}
}

public void takeSnapshot()
{
new stopRecord().start();
}