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:
Connect your IDE to all the code out there  Get Codota for Java