02-11-2013 07:44 AM
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!
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?
05-04-2013 01:45 PM
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
05-06-2013 02:13 PM
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.
You can just call camera,open(CameraUnit.Rear) at any point in your app, really.
05-06-2013 02:14 PM
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.
05-07-2013 06:43 AM
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.
05-07-2013 10:00 AM
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.
10-19-2013 08:23 PM
sorry to hijack the thread but this somehow is related to the question, and my cluster interest...
I too would have wished not resorting on C++ to invocate the camera. In the first version, I've basically embeded the came a la bomber example, but I would still like to have the full settings in the camera for the end user, and don't want to reinvent the wheel (that's what cards are for).
So, it's one more step for the user to go to the camera from file picker, which could I could have live with, but I need the front camera, which I don't have by default throught the file picker. I'd welcome the addition of a parameter to the filepicker card to tell which camera to use by default, that basically is having a complimentary sub query for the camera .
The other issue I have in the simulator that now "supports" the camera, is that it doesn't support the picture editor, that is it will raise a target not found error when setting imageCropEnabled: true. So I'd like to know if there is a way detecting that we are running in the simulator to have something like imageCropEnabled: not_in_simulator. I see that the model is BBSIM in the hardware settings, but I've got RIM BlackBerry Device in HardwareInfo.deviceName... I can check on the later to assume it is the simulator. But not sure how stable the name is.
I would have loved adding these request to jira, but the page nicely live locks when loading for me.