I have an Android app in which the screen orientation is set to portrait in the manifest file. It uses a custom camera in b / w to take a picture, and I need to save the photo.
Before saving the image, I need to rotate the image depending on how the user holds the camera so that the image is saved in the correct orientation.
So, is there a way by which I can get the orientation of the device, even when my application is running in portrait mode, and the Android auto-rotate feature is turned on. How can I achieve this?
source
share