02-11-2013 07:44 AM
Hi,
Trying to find a sample where the camera is opened from a button click. All examples i can find the camera view is already opened from start.
Any help to point me in the right direction would be much apprisiated!
/Johan
02-11-2013 09:02 AM
Do you want to integrate a custom camera view in your app or do you want to invoke the camera?
02-11-2013 09:04 AM
I just want to invoke the camera, get the image taken, upload it to my server.
2 weeks ago
Hi there! Any luck with it? I'm trying to implement the same thing.
Have you seen this other thread? http://supportforums.blackberry.com/t5/Cascades-De
Cheers!
2 weeks ago
Do you want to invoke the camera card, or build the camera UI inside your application? Invoking the camera card will require a bit of C++ (as mentioned in that thread), but can definitely be done. Starting and stopping the camera viewfinder from inside your app is also pretty easy, and can be done in QML. I believe the BarcodeScanner app starts the viewfinder after you press on the screen.
https://github.com/blackberry/Cascades-Samples/tre
You can just call camera,open(CameraUnit.Rear) at any point in your app, really.
2 weeks ago
Actually, why do you want to delay opening the camera? Even if you don't want it to be the first thing you see in the app, you probably want to have it off on it's own page.
2 weeks ago
On the docs page states that you can invoke the Camera app but it never mentions you can invoke it via QML so maybe this could be clearer.
But then I saw on this other docs page that you can already invoke some Cards in QML using the InvokeActionItem but apparently it doesn't work for the Camera app. So this is actually the new feature that I need. The work around is to do everything in C++ so It's not really high priority.
While reading all those pages I realized something: I want to integrate the device's cameras on my application without having to implement a complex camera module. I'm not an expert on camera stuff like focus, exposure, face detection and so on. But I know there's a high change that the user has other dedicated, feature rich Camera apps installed on their device so I want to be abble to leverage them.
But I guess this is not possible now, right? I was expecting to find something like bb.action.CAPTURE so I could invoke any app that can take pictures. Should this be another feature request?
I hope this is clear.
Cheers.
2 weeks ago
InvokeActionItem is a specialized class for automatically handling invocation of a certain subset of targets. It's really nice because it will do things like give you the correct icon, and handle the GUI to select the target you want to share to. It doesn't support any sort of generic invocation right now, unfortunately.
For things like the camera card specifically, you will notice that there is no onChildCardDone funciton or similar, so there is no way to get data back from an InvokeActionItem to begin with. This is definitely FR territory, so if you want to see it, please log it on the DIT.
If you want to invoke other apps registering for the bb.action.CAPTURE action, right now you would have to build the GUI yourself, but it would be possible. Might be a good FR to have that done in a generic way as well.
You probably don't want to build a camera UI yourself if you aren't doing something specific with that UI (ie, applying filters to the viewfinder, or drawing something over top of it). Depending on your use case, the camera card might not be the best option either. If you just want a jpeg that may or may not have been captured right now, you can use the FilePicker class. If you ask for a image, it will default to the camera folder, and have a button for the user to capture a picture right then and there. You can also do all of that right in QML.
I'd generally recommend the FIlePicker over the card, but it's worth considering either way.