×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    10

    Question can't show VideoControl on E52

    I want to take photo in my j2me application. It runs well on the emulator, but it exited without any error message when on E52.

    I just know that the application would crash if the VideoControl.setVisable(true) was called.

    Here are all the codes:
    Code:
    import java.io.IOException;
    
    import javax.microedition.lcdui.Canvas;
    import javax.microedition.lcdui.Command;
    import javax.microedition.lcdui.CommandListener;
    import javax.microedition.lcdui.Displayable;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    import javax.microedition.media.control.VideoControl;
    
    import com.crm.ui.base.DeviceScreen;
    import com.crm.ui.base.FrameSession;
    import com.crm.ui.base.Theme;
    
    public class CameraCanvas extends Canvas implements CommandListener {
    	
    	private VideoControl mVideoControl;
    	private Player mPlayer;
    	private DeviceScreen previous;
    	private final Command back;
    
    	public CameraCanvas(DeviceScreen previous) {
    		this.previous = previous;
    		back = new Command("back", Command.BACK, 2);
    		addCommand(back);
    		setCommandListener(this);
    		openResource();
    	}
    
    	private void openResource() {
    		try {
    			mPlayer = Manager.createPlayer(FrameSession.playerParameter);
    			mPlayer.realize();
    			mVideoControl = (VideoControl) mPlayer.getControl("VideoControl");
    			mVideoControl.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
    			mPlayer.start();
    			mVideoControl.setVisible(true);
    			mVideoControl.setDisplaySize(140, 140);
    		} catch (IOException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		} catch (MediaException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		} catch (Throwable e) {
    			
    		}
    	}
    
    	private void closeResource() {
    		mVideoControl = null;
    		if (mPlayer != null) {
    			try {
    				mPlayer.close();
    			} catch (Throwable e) {
    				e.printStackTrace();
    			}
    			mPlayer = null;
    		}
    	}
    
    	protected void paint(Graphics g) {
    		g.setColor(Theme.WHITE);
    		g.fillRect(0, 0, getWidth(), getHeight());
    	}
    
    	public void commandAction(Command c, Displayable d) {
    		if (c == back) {
    			closeResource();
    			previous.show();
    		}
    	}
    
    }
    Please help me! Thank you very much!

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: can't show VideoControl on E52

    Hello nathanieldai,

    could perform a test by using this code example: http://wiki.forum.nokia.com/index.ph...ots_in_Java_ME

    The code of the example MIDlet does not crash without exception on E52 with the latest firmware. If you test the example, does it crash also?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    10

    Unhappy Re: can't show VideoControl on E52

    Dear r2j7,

    Thank you for your help. Unfortunately, it still doesn't work.
    The platform shows "NokiaE52-1/031.010/sw_platform=S60;sw_platform_version=3.2;java_build_version=1.0.5", when System.getProperty("microedition.platform") is called.
    Are there some bugs in this platform?
    This problem made me crazy...

  4. #4
    Registered User
    Join Date
    Feb 2008
    Posts
    10

    Question Re: can't show VideoControl on E52

    Dear r2j7,

    Could you tell me the platform of the latest firmware which you have tested. Thank you very much!

    Regards,
    nathanieldai


    Quote Originally Posted by r2j7 View Post
    Hello nathanieldai,

    could perform a test by using this code example: http://wiki.forum.nokia.com/index.ph...ots_in_Java_ME

    The code of the example MIDlet does not crash without exception on E52 with the latest firmware. If you test the example, does it crash also?

    Regards,
    r2j7

  5. #5
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: can't show VideoControl on E52

    Hello nathanieldai,

    the firmware version for E52 which I used for testing is 33.002.

    For testing with that version and other devices, you could use Remote Device Access service:

    Home > Technology Topics > Application Quality > Testing > Remote Device Access > Remote Device Access Services

    Remote Device Access (RDA) is a service that allows developers to test their mobile applications and services remotely on various Nokia devices based on Symbian and Maemo OS. The main features of the service are remote controlling a device, installing and running applications, transferring files, and analyzing log files in real-time. RDA is an Internet-based solution and the basic requirements for using the service are a Forum Nokia user account, a standard Web browser, and Java Web Start (comes typically with JRE; version 5.0 or newer is required). Usage is free of charge for all Forum Nokia members.

    Regards,
    r2j7
    Last edited by r2j7; 2010-05-10 at 14:21.
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  6. #6
    Registered User
    Join Date
    Feb 2008
    Posts
    10

    Smile Re: can't show VideoControl on E52

    Dear r2j7,

    Thank you for your help! It works now!
    I just updated the platform to the latest version by PC suit, and the problem was solved. The latest version is 33.003. It seems that there is a bug in the old version.

    Regards,
    nathanieldai

    Quote Originally Posted by r2j7 View Post
    Hello nathanieldai,

    the firmware version for E52 which I used for testing is 33.002.

    For testing with that version and other devices, you could use Remote Device Access service:

    Home > Technology Topics > Application Quality > Testing > Remote Device Access > Remote Device Access Services

    Remote Device Access (RDA) is a service that allows developers to test their mobile applications and services remotely on various Nokia devices based on Symbian and Maemo OS. The main features of the service are remote controlling a device, installing and running applications, transferring files, and analyzing log files in real-time. RDA is an Internet-based solution and the basic requirements for using the service are a Forum Nokia user account, a standard Web browser, and Java Web Start (comes typically with JRE; version 5.0 or newer is required). Usage is free of charge for all Forum Nokia members.

    Regards,
    r2j7

  7. #7
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: can't show VideoControl on E52

    Hello nathanieldai,

    that's great to hear!

    It seems that there is a bug in the old version.
    Interesting, I will check this further. Thank you for your help in verifying this issue!

    Regards,
    r2j7
    Last edited by r2j7; 2010-05-11 at 17:39.
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

Similar Threads

  1. Replies: 4
    Last Post: 2009-12-08, 06:36
  2. is it possible to draw a line over videocontrol in a canvas?
    By byronlilu in forum Mobile Java General
    Replies: 13
    Last Post: 2008-11-28, 11:58
  3. Want to show the update screen
    By sweetsweet24 in forum Mobile Java General
    Replies: 2
    Last Post: 2008-11-28, 06:54
  4. VideoControl in a Form
    By SurfingPop in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2008-02-04, 23:35
  5. how to use browser control to show external image
    By aplyhj in forum Symbian User Interface
    Replies: 1
    Last Post: 2007-10-26, 06:00

Posting Permissions

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