In my Android application, I am taking pictures using the Android default camera for this purpose. I used below code. After I took the photo, I showed that the image is in another action in full screen. If I captured the image in portrait mode, I can set the entire image to full screen. he showed good, after showing the image I can perform my operation. But if I captured a photo with landscape , then the taken image will be installed on the screen with a stretched one. therefore, I would like to take photos using portrait mode, but not in the landscape. since I can block the camera app for portrait only.
String fileName = "Camera_Example.jpg"; ContentValues values = new ContentValues(); values.put(MediaStore.Images.Media.TITLE, fileName); values.put(MediaStore.Images.Media.DESCRIPTION,"Image capture by camera"); imageUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri); intent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION,ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); startActivityForResult(intent,CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
AndroidManifest.xml
<activity android:name=".TestActivity" android:screenOrientation="portrait" android:configChanges="orientation" android:theme="@android:style/Theme.NoTitleBar" > </activity>
portrait taken 
portrait shot photo full screen 
landscape shot photo 
full-screen landscape 
android android-orientation android-camera-intent
Jamal
source share