title: Android auto focus when continuous auto focus modes are not supported
body: <p>I have a camera in my app and I want to make it auto focus continuously in the same way that the phone's camera does it. I found the modes <code>FOCUS_MODE_CONTINUOUS_VIDEO</code> and <code>FOCUS_MODE_CONTINUOUS_PICTURE</code>, but they are not supported by some of the HTC Gingerbread phones I'm testing on.</p>
  
  <p>This is what I'm doing to determine whether I can use these modes:</p>
  
  <pre><code>        Camera.Parameters parameters = mCamera.getParameters();
          List&lt;String&gt; supportedFocusModes = parameters.getSupportedFocusModes();
  
          if (android.os.Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.ICE_CREAM_SANDWICH &amp;&amp;
              supportedFocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE)) {
              parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
          }
          else if (supportedFocusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {
              parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
          }
          else if (supportedFocusModes.contains(Camera.Parameters.FOCUS_MODE_AUTO)) {
              // auto focus on request only
              parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);
          }
  </code></pre>
  
  <p>Running on several different Gingerbread HTC phones I don't get the continuous modes back, but I get "auto". This lets me auto focus on demand (when I call <code>mCamera.autoFocus(null)</code>, but the camera will not refocus if the user moves the camera.</p>
  
  <p>I cannot set the focus mode to anything the camera does not support, and if I do it shows up blank.</p>
  
  <p>One solution that I tried is to call <code>mCamera.autoFocus(null)</code> on a timer. This causes the camera to refocus continuously, even if it is already in focus.</p>
  
  <p>Is there a way to implement a continuous auto focus experience on these phones? When I look at HTCs camera app on these phones it does have continuous auto focus - as you move around the camera refocuses and does not keep refocusing once the picture is in focus.</p>