×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    13

    Can we control the camera open and close events from our midlet application

    Hi,

    I want to control the camera open and close events using midlet application.

    Is this possible??

    thanks,
    Mamatha

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: Can we control the camera open and close events from our midlet application

    Hi Mamatha,
    I did a bit of work on the same,what you are talking about -
    I am writing the code here and here it is -

    /**
    * Creates camera control and places it to cameraForm.
    * @throws IOException if creation of player is failed.
    * @throws MediaException if creation of player is failed.
    */
    private void createCamera() throws IOException, MediaException
    {
    player = Manager.createPlayer("capture://video");
    player.realize();
    player.prefetch();

    videoControl = (VideoControl)player.getControl("VideoControl");
    }
    And start the camera -
    /**
    * Start camera player
    * @throws IOException if starting of player is failed.
    * @throws MediaException if starting of player is failed.
    */
    private void startCamera() throws IOException, MediaException
    {
    if(player.getState() == Player.PREFETCHED)
    {
    player.start();
    }
    }
    And in order to close the Camera -
    if(player != null)
    {
    player.deallocate();
    player.close();
    }

    Please check for the link below -
    http://developers.sun.com/mobility/m...icles/picture/
    I hope that these lines can help you in any means,
    Thanks,
    Last edited by raj_J2ME; 2008-12-17 at 09:19. Reason: URL added
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    13

    Re: Can we control the camera open and close events from our midlet application

    Hi Raj,
    Thanks for the reply.

    But my requirement is that my application should get the camera open and close events.
    i.e if user opens the camera the application should get notified.

    In your reply it is to explicitly on the camera and take images and then close it.

    Hope you got my requirement.

    Thanks and Regards,
    Mamatha

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: Can we control the camera open and close events from our midlet application

    Hi mamatha_j2me,
    I see,this is like a good query,
    However it is very hard to say that I dont have the idea about it..Still I found this link in my links folder and here it is.Check whether it can help you in any means....
    http://wiki.forum.nokia.com/index.ph...rce_in_Java_ME

    Thanks,
    raj_J2ME
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Can we control the camera open and close events from our midlet application

    There are no specific camera events.

    If you have a Canvas displayed, you will probably get hideNotify() and showNotify() events when the camera is opened and closed. But you will also get these events when the application is hidden for any other reason (like a phone call).

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: Can we control the camera open and close events from our midlet application

    Quote Originally Posted by grahamhughes View Post
    There are no specific camera events.

    If you have a Canvas displayed, you will probably get hideNotify() and showNotify() events when the camera is opened and closed.
    Hey Grahm,
    Thats fantastic one you know..I guess thats the only idea which can help for the underlined task...Thanks a lot..
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. Open and then close browser from midlet??
    By rakeshyadav in forum Mobile Java General
    Replies: 1
    Last Post: 2008-11-14, 14:43
  2. Replies: 4
    Last Post: 2007-10-03, 20:55
  3. Avoid system camera application interrupt
    By mopa in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2007-09-04, 09:42
  4. Opening connection to the secure element fails when restarting the midlet.
    By tfroidcoeur in forum Near Field Communication
    Replies: 6
    Last Post: 2007-08-24, 08:38
  5. Nokia N91, how to close the music application in the background?
    By goodluck_975 in forum General Development Questions
    Replies: 3
    Last Post: 2007-03-08, 14:48

Posting Permissions

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