Code example for Camera.CameraInfo

Methods: getCameraInfo

     * gone through due to being (think of the display as doing the work  
     * necessary to orient the camera). The camera orientation is reversed 
     * if the camera is facing the user since the image is mirrored. 
    public void setCameraDisplayOrientation() { 
        CameraInfo cameraInfo = new CameraInfo();
        Camera.getCameraInfo(mDefaultCameraId, cameraInfo);
        int rotation = getWindowManager().getDefaultDisplay().getRotation();
        int degrees = 0;
        switch (rotation) {
            case Surface.ROTATION_0:
                degrees = 0;
            case Surface.ROTATION_90:
                degrees = 90;
            case Surface.ROTATION_180:
                degrees = 180;
            case Surface.ROTATION_270:
Stop searching for code, let great code find you!  Add Codota to your java IDE