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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 22
Registered: ‎11-12-2012
My Device: Bold 9900
My Carrier: Bell
Accepted Solution

Setting camera focus mode

[ Edited ]

G'Day,

 

I am trying to set the camera focus mode and have run into a problem.  The modes return from camera_get_focus_modes(*) indicate that six focus modes are now supported.  But when I try to set one of these modes via a call to camera_set_focus_mode(*) the call returns

 

  CAMERA_EOPNOTSUPP  

 

which is documented to mean:"The function call failed because the requested operation is not supported."

 

Is this simply an artifact of the DevAlpha?  That is, the focus modes returned by camera_get_focus_modes(*) *will* be implemented by the real hardware but not on the DevAlpha?  Or am I doing something blindingly stupid?

 

EDIT: Using DevAlpha B.

 

Thanking you in advance...  -Sam.

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

Re: Setting camera focus mode

The viewfinder needs to be running first.

There is a sample here which runs through the various focus modes:

https://github.com/blackberry/Presentations/tree/master/2012-BlackBerryJam-Americas/JAM15/Focus

 

Cheers,

Sean

Contributor
Posts: 22
Registered: ‎11-12-2012
My Device: Bold 9900
My Carrier: Bell

Re: Setting camera focus mode

Thank-you for this. Fwiw, this was not clear from the documentation nor the return code, at least to someone like me. Regards and thanks again -Sam.
BlackBerry Development Advisor
Posts: 683
Registered: ‎11-29-2011
My Device: PRIV
My Carrier: Rogers

Re: Setting camera focus mode

I will see about changing the behaviour.. it sounds like a bug that we reported a non-empty list of focus modes when the camera had not been started yet.

Highlighted
Contributor
Posts: 22
Registered: ‎11-12-2012
My Device: Bold 9900
My Carrier: Bell

Re: Setting camera focus mode

Yes, the focus modes query should fail if they cannot be set or effected.

 

Thanks for your help.  And thanks much for the reference to all those Jam demos.  Very helpful.  Are there any other sample caches that are not explicitely referenced in either the community section or the official section?

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

Re: Setting camera focus mode

all camera-related samples are linked to from the camera community wiki page here:

http://blackberry.github.com/Community/Camera.html

 

I just checked the implementation, and yes, it looks like the camera_get_focus_modes() API is hooked up in a state-independent way.  I will look at getting this fixed.  This list should not likely be queryable without a viewfinder running, because the list may vary based on which mode is currently selected.  It doesn't presently, but in the future it may.