title: Android Camera AutoFocus on Demand
body: <p>The built in Camcorder App (like the one on the HTC EVO) seems to call <code>camera.autoFocus()</code> only when the preview image changes. If you hold the camera steady no <code>camera.autoFocus()</code> happens.<br>
    I would like to duplicate this behavior while <code>camera.startPreview()</code> is active as in the initial preview setup code below:</p>
  
  <pre><code>camera = camera.open();
  Camera.Parameters parameters = camera.getParameters();
  List&lt;String&gt; focusModes = parameters.getSupportedFocusModes();
  if (focusModes.contains(Camera.Parameters.FOCUS_MODE_AUTO))
  {
      parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);
  }
  camera.setParameters(parameters);
  camera.setPreviewDisplay(holder);
  camera.startPreview();
  </code></pre>
  
  <p>All the examples I found for <code>autoFocus()</code> seem to be calling it every 500ms to 2000ms, or once the instant before the picture is taken or recording is started.<br>
    The EVO Camcorder app seems to use a sensor or an algorithm to trigger <code>autoFocus()</code>. However this <code>autoFocus()</code> trigger is done it works exceptionally well. Does anyone have any knowledge of how to trigger <code>autoFocus()</code> on demand when it is needed, such as when the camera is moved close or farther from the subject or is panned slightly?
  Thank you,
  Gerry</p>