Code example for Camera

Methods: getParameterssetParameterssetPreviewDisplaystartPreview

0
	public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
		if (mCamera == null || getPreviewSize() == null) {
			return; 
		} 
 
		Camera.Parameters parameters = mCamera.getParameters();
		Size previewSize = getPreviewSize();
		parameters.setPreviewSize(previewSize.width, previewSize.height);
 
		mCamera.setParameters(parameters);
		previewCamera(); 
 
	} 
 
	@Override 
	public void onPictureTaken(byte[] imageData, Camera camera) {
		if (imageData != null && mCameraCallback != null) {
			mCameraCallback.onPictureTaken(StoreByteImage(imageData));
		} 
		previewCamera(); 
	} 
 
	public void previewCamera() { 
		if (mCamera == null){
			return; 
		} 
		try { 
			mCamera.setPreviewDisplay(mHolder);
			mCamera.startPreview();
		} catch (Exception e) {
			Logger.w(TAG, "Cannot start preview.", e);
		} 
	} 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE