Camera camera = Camera.open(); camera.setDisplayOrientation(0);
Camera camera = Camera.open(); camera.setDisplayOrientation(90);In this example, the camera orientation is set to 90 which represents portrait mode. Again, this code should be placed before calling the startPreview method. Both examples use the android.hardware.Camera class, which is part of the Android SDK. Package library: android.hardware