Code example for Camera

Methods: getParameterssetDisplayOrientationsetParameterssetPreviewDisplay

0
        vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
         
        // camera 
        SurfaceView dummyView = new SurfaceView(this);
        camera = Camera.open(); // may need async task if slow
        Camera.Parameters cameraParameters = camera.getParameters();
        cameraParameters.set("preview-size", "800x480");
        //cameraParameters.set(key, value) 
        camera.setDisplayOrientation(90);
        cameraParameters.setRotation(90);
        camera.setParameters(cameraParameters);     		
        try {camera.setPreviewDisplay(dummyView.getHolder());} catch (Throwable t) {Log.d(TAG, "setPreviewDisplay exception!");}
        cameraInUse = false;
         
    } 
     
    @Override 
    public void onDestroy() { 
		Toast.makeText(this, "AnnotationService Stopped", Toast.LENGTH_LONG).show();
		Log.d(TAG, "onDestroy");