Code example for Camera.Parameters

Methods: setFlashMode, setFocusMode, setJpegQuality, setPreviewFrameRate, setPreviewSize, setRotation

0
   */ 
  private void setupCamera() { 
    Log.d(LOG_TAG, "Setting up camera"); 
    camera = Camera.open(); 
    parameters = camera.getParameters(); 
    parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO); 
    parameters.setFlashMode(Camera.Parameters.FLASH_MODE_ON); 
    parameters.setJpegQuality(JPEG_QUALITY); 
    parameters.setRotation(270); 
    parameters.setPreviewFrameRate(PREVIEW_FRAMERATE); 
    parameters.setPreviewSize(PREVIEW_WIDTH, PREVIEW_HEIGHT); 
    camera.setParameters(parameters); 
    try { 
      camera.setPreviewDisplay(dummySurface.getHolder()); 
      camera.setPreviewCallback(new Camera.PreviewCallback() { 
        public void onPreviewFrame(byte[] frameData, Camera camera) { 
          try { 
            int pw = PREVIEW_WIDTH; 
            int ph = PREVIEW_HEIGHT; 
            // setting the preview image format to jpeg causes an error. 
            // that's why the yuv stream has to be converted manually.