Code example for Camera

Methods: setErrorCallbacksetPreviewDisplaystartPreview, sleep

0
            Camera.Parameters params = mCamera.getParameters();
            mCamera.release();
 
            if (!params.isSmoothZoomSupported() && !params.isZoomSupported()) {
                Log.v(TAG, "Device camera does not support zoom");
                assertTrue("Camera zoom stress test", false);
            } 
            else { 
                Log.v(TAG, "Device camera does support zoom");
 
                int nextZoomLevel = 0;
 
                for (int i = 0; i < NUMBER_OF_ZOOM_LOOPS; i++) {
                    runOnLooper(new Runnable() {
                        @Override 
                        public void run() { 
                            mCamera = Camera.open(CAMERA_ID);
                        } 
                    }); 
 
                    mCamera.setErrorCallback(mCameraErrorCallback);