Code example for Camera

Methods: setPreviewDisplay

0
        public void surfaceCreated(SurfaceHolder holder) { 
            camera=Camera.open(); 
 
            try  
            { 
            	camera.setPreviewDisplay(previewHolder); 
            } 
            catch (Throwable t) { 
                     
            } 
        } 
 
		public void surfaceChanged(SurfaceHolder surfaceHolder, int format, int w, int h) 
		{ 
			//Parameters params = camera.getParameters(); 
			//params.setPreviewSize(w, h); 
			//params.setPictureFormat(PixelFormat.JPEG); 
	        //camera.setParameters(params); 
	        camera.startPreview(); 
		}