I know that with Camera.open() and getParameter to check focus mode will work.
But it seems open the camera will have a little bit o开发者_Python百科f sound,which I don't want to ...
Any other way I can get whether the camera support autofocus or not ?
another method will be to set a autofocus callback listner. in this case. the callback will have a boolean parameter stating if autofocus was successful. so u can jus check whether autofocus was succesfull and proceed further ..
EDIT:
I found this code somewhere on SO
PackageManager pm = getPackageManager();
if(pm.hasSystemFeature(PackageManager.FEATURE_CAMERA) && pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_AUTOFOCUS)){
// do something..
}
PackageManager.FEATURE_CAMERA_AUTOFOCUS
and PackageManager.FEATURE_CAMERA
are available from API 7
.
精彩评论