开发者

how to check whether an android phone's camera support autofocus

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜