enable Camera Auto Focus - Android Camera

Android examples for Camera:Camera Focus

Description

enable Camera Auto Focus

Demo Code


import android.hardware.Camera;
import android.hardware.Camera.AutoFocusCallback;

public class Main{
    /**//  w  w  w  .  j  a va  2 s .  c  om
     *
     * @param camera
     * @return
     */
    public static boolean enableAutoFocus(final Camera camera) {
        final Camera.Parameters params = camera.getParameters();
        return params.getFocusMode().equals(
                Camera.Parameters.FOCUS_MODE_FIXED);
    }
    public boolean enableAutoFocus() {
        return enableAutoFocus(this.camera);
    }
}

Related Tutorials