01-12-2010 05:51 PM
Hi. See, I'm trying to get images using the camera of my Blackberry device using a Java application, but I can't find a decent code snippet I can use in order to do this. I was wondering if anyone can send me a simple code snippet in order to do this. Thanks in advance!
01-13-2010 05:02 AM
Welcome to the forums.
There are two demos shipped with the JDE that provide code to help with this:
a) In all 'current' models, the FileExplorer approach, which includes JournalListener code, will work. Basically you listen for additions of *.jpg files to the File System and process the photo from there (assuming it has come from the camera).
b) For 4.6 and above, the camera demo shows you what to do.
Alternatively, you can add an ApplicationMenuItem to the Media Explorer so that you pick up photos using it, thoughI have never done this.
01-13-2010 08:18 AM
Hi Peter. What JDE you talk about in the first solution? See, the thing is I need to to this for the 4.2 JDE. I'm trying to use this code snippet to create a player for the camera and set a Video Control in my Form. Does this help or I have to use a completely different way to use the camera within my app? Thanks for your help!
player = Manager.createPlayer("capture://video");//For Device
//Grab the video control and set it to the current display.
videoControl = (VideoControl) (player.getControl("VideoControl"));
item = (Item) videoControl.initDisplayMode(GUIControl.USE_GUI_PR
item.setLayout(Item.LAYOUT_CENTER | Item.LAYOUT_VCENTER);
01-13-2010 08:38 AM
What you are trying to do is option B from @Peter's post. You can only do that in 4.6 and higher. If you need it for 4.2 you need to do option A where you start the built in camera application, and listen for a new file to be written to the device memory. You can then use that image for whatever you want.
01-13-2010 08:51 AM
rcmaniac25 is correct, the only other thing I would add is that I believe the FileExplorerDemo which uses the FileSystemJournalListener to pick up new pictures was first shipped with 4.3 JDE. It works in 4.2 and above (assuming it has been compiled on the correct level of course).
01-18-2010 08:44 AM
Hi Peter. In the example, I can get an Image from the File System, however, I don't quite know how to start the Camera application from my own application to get the picture. I saw that in the JDE 4.5 there's a EmbeddedMediaDemo sample, can I use that to get the picture? I hope you can help me and thanks for all so far.