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

Native Development

Reply
Highlighted
Developer
Posts: 74
Registered: ‎05-31-2013
My Device: BlackBerry Z30
Accepted Solution

Add camera functionaility to app

I am creating an app using Cascades and want to use the camera to take 2 images. I do not want these images saved to the camera roll. If possible, only have them saved to memory and nowhere else. Is this possible to do in QML?

 

I also want to restrict the user from turning on things like HDR, burst mode, etc. I just want the user to be able to take pictures with or without flash and handle the pictures in the app, without saving the photos to the device's photos.

 

Is this possible?



Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: Add camera functionaility to app

To use the image file take from the camera you will need the camera permission as well as the shared files permission.

 

The pictures are always saved to the camera folder, last time i checked there was no way around this.  You can however move the images to your applications data folder and then delete them from the camera directory..

 

the users will only have access to the settings you give them.

Developer
Posts: 147
Registered: ‎05-31-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: Bonbon

Re: Add camera functionaility to app

There is a way around this but you have to do some serious work in C and override or not use camera roll functions. Using fstream and save in Sandbox folder with right permissions.

In QML, not available.

Developer
Posts: 74
Registered: ‎05-31-2013
My Device: BlackBerry Z30

Re: Add camera functionaility to app


slashkyle wrote:

To use the image file take from the camera you will need the camera permission as well as the shared files permission.

 

The pictures are always saved to the camera folder, last time i checked there was no way around this.  You can however move the images to your applications data folder and then delete them from the camera directory..

 

the users will only have access to the settings you give them.


Do you know if this is how Snap2Chat works? I know the images you take there don't show in your camera folder.



Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Developer
Posts: 74
Registered: ‎05-31-2013
My Device: BlackBerry Z30

Re: Add camera functionaility to app


knobtviker wrote:

There is a way around this but you have to do some serious work in C and override or not use camera roll functions. Using fstream and save in Sandbox folder with right permissions.

In QML, not available.


That's what I was afraid of. I don't exactly want to reinvent the wheel if I can avoid it. Thanks for the quick reply!



Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Add camera functionaility to app

It's not really that hard, we have a sample called BestCamera that shows you how to use the C Camera API in Cascades. You aren't really doing a lot of work to avoid the things the Cascades camera or Camera Card gives you, it's more that you would have to do a lot to implement those features with the C api.

 

For image saving specifically, with the C API when you capture an image you just get a JPEG buffer back that exists only in memory. From there it's up to you to save wherever you like. Best camera does that, you could just change where it saves it for you.

 

https://github.com/blackberry/Cascades-Community-Samples/tree/master/BestCamera

 

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Developer
Posts: 74
Registered: ‎05-31-2013
My Device: BlackBerry Z30

Re: Add camera functionaility to app

 


PBernhardt wrote:

It's not really that hard, we have a sample called BestCamera that shows you how to use the C Camera API in Cascades. You aren't really doing a lot of work to avoid the things the Cascades camera or Camera Card gives you, it's more that you would have to do a lot to implement those features with the C api.

 

For image saving specifically, with the C API when you capture an image you just get a JPEG buffer back that exists only in memory. From there it's up to you to save wherever you like. Best camera does that, you could just change where it saves it for you.

 

https://github.com/blackberry/Cascades-Community-Samples/tree/master/BestCamera

 



This is exactly what I was hoping for. All the options I kept finding saved it to the camera roll, which I didn't want! Thank you so much!



Like this answer? Give it a
Visit my blog for programming help, guides and common issues.
Developer
Posts: 147
Registered: ‎05-31-2013
My Device: BlackBerry Z10 Limited Edition
My Carrier: Bonbon

Re: Add camera functionaility to app

Best Camera also saves using camera roll AFAIK. Snap2Chat dev uses a modified C class to save into Sandbox folder using fstream. Smiley Happy

To be honest, save path should really be exposed as an option in QML and should default to camera roll path.

Only BlackBerry can do that kind of modification to its Cascades control unfortunately.

Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Add camera functionaility to app

BestCamera does it because that's what most people want. It's just a sample though, so you can change it to wherever you want. BestCamera implements the actual saving funcionality itself.

 

You can also change where images get saved in the Cascades control (CloudyPics does that to let you save to the SD card or DropBox)

 

http://devblog.blackberry.com/2013/10/cloudy-pics-part-2-managing-the-camera-roll/

 

The limitation there is that it can't save into you're app's sandbox, because it's a different process and doesn't have permisison to write there.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: Add camera functionaility to app

[ Edited ]

PBernhardt wrote:

 

The limitation there is that it can't save into you're app's sandbox, because it's a different process and doesn't have permisison to write there.


One would think the Camera permission should be sufficient enough to overcome this obstacle by now...