Code example for Camera

Methods: getParameterssetParameterssetPreviewDisplaystartPreviewstopPreview

0
    { 
        Log.e(TAG, "surfaceChanged");
 
        // XXX stopPreview() will crash if preview is not running 
        if (mPreviewRunning) {
            mCamera.stopPreview();
        } 
 
        Camera.Parameters p = mCamera.getParameters();
        p.setPreviewSize(w, h);
        mCamera.setParameters(p);
        try { 
			mCamera.setPreviewDisplay(holder);
		} catch (IOException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
        mCamera.startPreview();
        mPreviewRunning = true;
    } 
 
    public void surfaceDestroyed(SurfaceHolder holder)
    { 
Stop searching for code, let great code find you!  Add Codota to your java IDE