Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User freeair7's Avatar
    Join Date
    Jun 2009
    Posts
    2
    3G mobile phone usually has two cameras. My question is how to observe camera devices of Nokia device in J2ME application, then I can choose one for video capture.

    Thanks for reply.

  2. #2
    Registered User ektasrv's Avatar
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941
    Quote Originally Posted by freeair7 View Post
    3G mobile phone usually has two cameras. My question is how to observe camera devices of Nokia device in J2ME application, then I can choose one for video capture.

    Thanks for reply.
    you have to use
    Player p = Manager.createPlayer("capture://video");

    Camera snapshot for pictures or video recording.

    You can also use the following:
    capture://devcam0 (for video recording and image capture) default cam
    capture://devcam1 (second camera, if the device has two cameras) front cam
    Thanks,
    Ekta

  3. #3
    Nokia Developer Moderator r2j7's Avatar
    Join Date
    Aug 2007
    Posts
    1,595
    Hello freeair7,

    and welcome to Forum Nokia Discussion Boards!

    The cameras on Nokia devices can be accessed by using Mobile Media API (MMAPI). More specifically:

    When creating a MMAPI Player for audio or video capture, or specific capture, the locator URL must be used as a parameter to the createPlayer method of the Manager class. And in order to access a camera/cameras for the purpose, the following locators come in question:

    capture://devcam0 (for video recording and image capture)
    capture://devcam1 (second camera, if the device has two cameras)

    More about usage of these in Forum Nokia Java Developer's Library:

    Java Developer's Library 3.5 > Developer's Guides > Multimedia > Creating multimedia applications > Using the Mobile Media API > Recording sound and video

    Furthermore on determining existing cameras by using these locators, you might want to check this code example on Forum Nokia Wiki:

    CS001273 - Determining the number of cameras in Java ME

    Regards,
    r2j7

  4. #4
    Registered User ektasrv's Avatar
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941
    You can try System property - "camera.resolutions" to get the following:

    camera.resolutions

    A list of camera device sensor resolutions.

    [locator_name] [width]x[height]

    For example:

    capture://devcam0 640x480
    capture://devcam1 320x240
    Thanks,
    Ekta

  5. #5
    Registered User freeair7's Avatar
    Join Date
    Jun 2009
    Posts
    2
    Quote Originally Posted by ektasrv View Post
    You can try System property - "camera.resolutions" to get the following:

    camera.resolutions

    A list of camera device sensor resolutions.

    [locator_name] [width]x[height]

    For example:

    capture://devcam0 640x480
    capture://devcam1 320x240
    I try it on Nokia X6, nothing is returned by System.getProperty("camera.resolutions")

  6. #6
    Registered User ektasrv's Avatar
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941
    Quote Originally Posted by freeair7 View Post
    I try it on Nokia X6, nothing is returned by System.getProperty("camera.resolutions")
    To get number of Camera on the device - Try this type of codelet on X6

    Code:
    private int getNumOfCam() {
            int cam = 0;
     
            try {
                for( ; ; ++cam) {
                    String locator = "capture://devcam" + Integer.toString(cam);
                    Player player = Manager.createPlayer(locator);
                    player.close();
                }
            }
            catch(MediaException mediaExc) {            
                return cam;
            }
            catch(Exception exc) {
                return 0;
            }
        }
    Thanks,
    Ekta

Similar Threads

  1. Nokia 6220c Camera doesnt work
    By tearcodiac in forum General Development Questions
    Replies: 2
    Last Post: 2009-12-28, 17:16
  2. n73 fullscreen camera odd behaviour
    By g_costanza in forum Python
    Replies: 2
    Last Post: 2009-04-05, 10:16
  3. Enable Skin with Custom List Box
    By hmleung in forum Symbian User Interface
    Replies: 5
    Last Post: 2007-11-12, 09:55
  4. File browser Problem
    By Marwa in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2007-05-05, 22:41
  5. Startup Management list API for unprotected uids
    By mateen_maldar in forum Symbian User Interface
    Replies: 8
    Last Post: 2006-09-27, 09:32

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved