title: How to capture photo automatically in android phone?
body: <p>I have developed an android application. In that i have used front facing camera functionality. Its working fine but I need to auto capture. i.e. without click shutter button sound, I want to capture photocode..</p>
  
  <p>my <strong>camera activity</strong> code is</p>
  
  <pre><code> private Camera openFrontFacingCameraGingerbread() { 
      int cameraCount = 0; 
      Camera cam = null; 
      Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); 
      cameraCount = Camera.getNumberOfCameras(); 
      for ( int camIdx = 0; camIdx &lt; cameraCount; camIdx++ ) { 
          Camera.getCameraInfo( camIdx, cameraInfo ); 
          if ( cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT  ) { 
              try { 
                  cam = Camera.open( camIdx ); 
              } catch (RuntimeException e) { 
                  Log.i("Camera failed to open: ",e.getLocalizedMessage()); 
              } 
          } 
      } 
      return cam; 
  } 
  </code></pre>
  
  <p>Thanks in advance..</p>