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

Java Development

Reply
Developer
donturner
Posts: 135
Registered: ‎11-14-2010
My Device: BlackBerry Z10 (White)

FocusControl on OS5 devices

Is it possible to access FocusControl on OS5 devices? 

 

According to the documentation it is:

 

http://www.blackberry.com/developers/docs/5.0.0api/javax/microedition/amms/control/camera/FocusContr...

 

But when I do the following: 

 

_player = Manager.createPlayer("capture://video?encoding=jpeg&width=1024&height=768&quality=normal");
_player.realize();
_player.start();
_fc = (FocusControl) _player.getControl("FocusControl");

 _fc is null. Any ideas? 

 

 

BlackBerry Development Advisor
MSohm
Posts: 14,753
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: FocusControl on OS5 devices

The FocusControl interface must be present to comply with the JSR specification (so that cross platform applications don't break when attempting to run).  However, all controls are not supported.  Null is returned if the control is not supported, which is the case here.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
donturner
Posts: 135
Registered: ‎11-14-2010
My Device: BlackBerry Z10 (White)

Re: FocusControl on OS5 devices

[ Edited ]

Bit of an update, when I do: 

 

FocusControl focusControl = (FocusControl)player.getControl("javax.microedition.amms.control.camera.FocusControl");

 I do get a FocusControl object, however the

setMacro()

and

setFocus()

methods do nothing. 

 

All I'm trying to do is replicate what the native camera already does - focus immediately before taking a photo. Is there any way of achieving this?

BlackBerry Development Advisor
MSohm
Posts: 14,753
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: FocusControl on OS5 devices

FocusControl is only supported in BlackBerry Device Software version 6.0 and higher.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
donturner
Posts: 135
Registered: ‎11-14-2010
My Device: BlackBerry Z10 (White)

Re: FocusControl on OS5 devices

So is the only way to get the camera to focus on OS5 to call VideoControl.getSnapshot()?

BlackBerry Development Advisor
MSohm
Posts: 14,753
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: FocusControl on OS5 devices

Correct.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
donturner
Posts: 135
Registered: ‎11-14-2010
My Device: BlackBerry Z10 (White)

Re: FocusControl on OS5 devices

Many thanks Mark.