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

Super Contributor
Posts: 440
Registered: ‎01-13-2011
My Device: Playbook
My Carrier: NA

Flash always on - CAMERA

I've looked at the camera native sample app and I am adjusting it, just having a newbie play really.


I'm trying to get the flash to always be on but am not having any luck, any ideas?


hasFlash is a bool.


 camera_error_t err;
    // open the specified camera
    err = camera_open(unit,
                      CAMERA_MODE_RW | CAMERA_MODE_ROLL,
    if (err != CAMERA_EOK) {
        fprintf(stderr, "camera_open() failed: %d\n", err);
        return err;

    hasFlash = camera_can_feature(handle, CAMERA_FEATURE_FLASH);




BlackBerry Apps: Instruments | ARTPAD | Piano | Drums | Xylophone
Posts: 155
Registered: ‎07-16-2012
My Device: Dev Alpha
My Carrier: Bell

Re: Flash always on - CAMERA


Hi JeffLemon,


take a look at the HelloVideoCamera Sample App, available under https://github.com/blackberry/Cascades-Community-Samples/tree/master/HelloVideoCamera


Try to add


camera_config_videolight(mCameraHandle, CAMERA_VIDEOLIGHT_ON);


into void HelloVideoCameraApp:Smiley SurprisednStartRear(), such as:


void HelloVideoCameraApp::onStartRear()
    qDebug() << "onStartRear";
    if (mViewfinderWindow) {
        if (createViewfinder(CAMERA_UNIT_REAR,
                             mViewfinderWindow->windowId().toStdString().c_str()) == EOK) {
            qDebug() << "created viewfinder";
            camera_config_videolight(mCameraHandle, CAMERA_VIDEOLIGHT_ON);

 Hope this helps.

BlackBerry Development Advisor
Posts: 675
Registered: ‎11-29-2011
My Device: PRIV
My Carrier: Rogers

Re: Flash always on - CAMERA

Are you trying to turn the LED on?  Or do you want the flash to fire each time you take a picture?


If all you want is the LED with no camera, then you should be able to:


camera_config_videolight(handle, CAMERA_VIDEOLIGHT_ON);


If you are actully trying to force the flash to fire on each photo you take, then you would use camera_config_flash().  I have sample code coming for this....