Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
BlackBerry Development Advisor
shaque
Posts: 227
Registered: ‎07-14-2008
My Device: Not Specified

Using the built-in camera to get an image programmatically

The solution is in two parts.

 

First, you will have to invoke tha camera app by calling net.rim.blackberry.api.invoke.Invoke.invokeApplication(int appType, ApplicationArguments args).

 

Next, you need to implement a net.rim.device.api.io.file.FileSystemJournalListener to listen for changes in the file system. A change in the file system may represent that a picture has been taken using the camera application and is saved. Once this event is triggered, you can use net.rim.device.api.io.file.FileSystemJournal to get the path of the image file and you are good to go from here.

 

Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Using the built-in camera to get an image programmatically

You can reference the fileexplorer demo that is included with the BlackBerry JDE for an example of this.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
BlackBerry Development Advisor (Retired)
bzubert
Posts: 86
Registered: ‎07-11-2008
My Device: Not Specified

Re: Using the built-in camera to get an image programmatically

In 4.6, the camera itself can be embedded within your application.  Check out VideoControl.getSnapshot().  The camerademo in the samples directory of JDE 4.6 demonstrates how to use this API.

 

http://na.blackberry.com/eng/developers/devbeta.jsp#tab_tab_jde

Brian Zubert
Technical Partnership Manager
Research In Motion
Please use plain text.
New Developer
maustin75
Posts: 3
Registered: ‎09-23-2008
My Device: Not Specified

Re: Using the built-in camera to get an image programmatically


bzubert wrote:

In 4.6, the camera itself can be embedded within your application.  Check out VideoControl.getSnapshot().  The camerademo in the samples directory of JDE 4.6 demonstrates how to use this API.

 

http://na.blackberry.com/eng/developers/devbeta.jsp#tab_tab_jde


I thought the VideoControl was just for playing video. I couldn't figure out how to view live video from the camera? Are you sure it's for live video FROM the camera? If so can you paste the specific code?

 

Thanks

Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Using the built-in camera to get an image programmatically

The preview window is live from the built in camera.  Please have a look at the camerademo included with the version 4.6 BlackBerry JDE for an example.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
Abhijit
Posts: 105
Registered: ‎07-24-2008
My Device: Not Specified

Re: Using the built-in camera to get an image programmatically

Hi...I am using getSnapshot(), and able to take a picture.But the quality of the image is not good at all as compared to the image taken with the Blackberry Camera application.I tried all possible encoding options.Any more sugestions?

 

Thanks,

Abhijit

Please use plain text.