Hi,
I am using JSR 234 and hardware is N97mini.
Creating a sample camera application and want to set auto-focus. just followed the JSR 234 documentation coming with the sdk. the code snippet is as below:
Player p;
CameraControl cameraControl;
FocusControl focusControl;
// Use autofocus if it is available:
focusControl = (FocusControl) // always getting focuscontrol as NULL
p.getControl("javax.microedition.amms.control.camera.FocusControl");
if(focusControl != null) {
if(focusControl.isAutoFocusSupported()) {
try {
focusControl.setFocus(FocusControl.AUTO);
} catch(MediaException e) {
//Shouldn't happen.
}
}
}
else
{
//control comes here as focuscontrol is set as null
}
the problem is :
focusControl = (FocusControl) p.getControl("javax.microedition.amms.control.camera.FocusControl");
after above call focuscontrol is set as NULL.
can anybody help me to fix this issue.


Reply With Quote

