I would like my app to force a user to turn their phone sideways to take an image. In other words, I would like the image to be taken in landscape mode. How do I go about this?
At the very least, the image will be taken and saved in landscape even if user does not tilt their phone to the side.
You can simply add this line in your onCreate()
method inside your activity
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
or if you need portrait write this
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);