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
New Contributor
Posts: 8
Registered: ‎07-03-2010
My Device: Curve
My Carrier: Whatever

Develop a function to capture an image and display it in FieldManager

Sorry, noob programmer's here.. I wonder how to build a function, when we click a button, it will switch on the camera, and after you snap a photo, it will display it directly in FIeldManager like VerticalFieldManager? Can you guys show me the code example?

 

I'm building an Java application which has the snap-and-use function in Foursquare, or other society networking application like Freindster, Facebook etc..

 

Please help..

 

 

Developer
Posts: 248
Registered: ‎11-23-2009
My Device: Not Specified

Re: Develop a function to capture an image and display it in FieldManager

To invoke the native BB Camera you can use the below line:

 

//Start Camera
Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA,new CameraArguments());   

Once you have clicked on the image a new image file gets created in the device's memory. You can display this in the fieldmanager....

 

btw to know when a new file is getting added to your device (.i.e. to get hold of the image file created after you have clicked the image) you can create a class that implements the FileSystemJournalListener interface. Here you can override the fileJournalChanged method to get the file and then simply display the same.

 

This link should give you a better idea of what i am saying:

 

http://docs.blackberry.com/en/developers/deliverables/11942/Detect_when_img_is_added_or_removed_file...

 

hope that helps!

Saket