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.
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
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
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
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