Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: how to get default camera settings of builtin camera application
    primarykey
    data
    text
    <p>I have seen lots of tutorial and information but i could not find any single place how to use the default settings of the existing camera application into any other customized camera application. I have seen the sharpness of the image and its focus is very fine in the built-in camera application. Now i am creating my own application with my customized features but i am still unable to make it sharp and non-blurry... I dont want to use Intent technique of the camera because i have to do some image processing afterward. </p> <p>I have used zooming but strangely zoom is not properly working ...like it works in built-in camera application</p> <p>here is my surface change code </p> <pre><code> public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { Log.e(TAG, "surfaceChanged"); // XXX stopPreview() will crash if preview is not running if (mPreviewRunning) { mCamera.stopPreview(); } Camera.Parameters params = mCamera.getParameters(); List&lt;Camera.Size&gt; sizes = params.getSupportedPreviewSizes(); mFrameWidth = w; mFrameHeight = h; // selecting optimal camera preview size { double minDiff = Double.MAX_VALUE; for (Camera.Size size : sizes) { if (Math.abs(size.height - h) &lt; minDiff) { mFrameWidth = size.width; mFrameHeight = size.height; minDiff = Math.abs(size.height - h); } } } try { //params.set("rotation", 180); //params.set("orientation", "landscape"); //params.set("auto", "WHITE_BALANCE_AUTO");//WHITE_BALANCE_AUTO Display display = ((WindowManager)getSystemService(WINDOW_SERVICE)).getDefaultDisplay(); if(display.getRotation() == Surface.ROTATION_0) { params.setPreviewSize(mFrameHeight, mFrameWidth); mCamera.setDisplayOrientation(90); } if(display.getRotation() == Surface.ROTATION_90) { params.setPreviewSize(mFrameWidth, mFrameHeight); } if(display.getRotation() == Surface.ROTATION_180) { params.setPreviewSize(mFrameHeight, mFrameWidth); } if(display.getRotation() == Surface.ROTATION_270) { params.setPreviewSize(mFrameWidth, mFrameHeight); mCamera.setDisplayOrientation(180); } if(params.isZoomSupported()) { Log.e(TAG, params.getZoom()+"surfaceChanged camer zoom"+params.getMinExposureCompensation()); params.setZoom(params.getMaxZoom()); params.setExposureCompensation(1); // params.setColorEffect("none"); params.setWhiteBalance(params.WHITE_BALANCE_AUTO); params.setFocusMode(params.FOCUS_MODE_AUTO); params.setSceneMode(params.SCENE_MODE_ACTION); } params.set("auto", "FOCUS_MODE_AUTO"); params.setPreviewSize(mFrameWidth,mFrameHeight); mCamera.setParameters(params); mCamera.setPreviewDisplay(holder); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } mCamera.startPreview(); mPreviewRunning = true; } </code></pre> <p>Kindly let me know how to make the camera preview exactly same as the built in application one.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload