![]() ![]() When looking at the screen, the rotation seems to be in the clockwise direction, this is because the rear-camera sensor is installed on the “back” side of the device.Īccording to Android 10 Compatibility Definition 7.5.5 Camera Orientation , front and rear-facing cameras “MUST be oriented so that the long dimension of the camera aligns with the screen’s long dimension.”. Put differently, sensor orientation is the number of degrees a sensor is rotated counterclockwise before being mounted on the device. Tablets are a bit more complicated than this - they can be either portrait or landscape.įormally speaking, sensor orientation is measured by the degrees an output image from the sensor needs to be rotated clockwise to match the natural orientation of the device. For laptops, their natural orientation is landscape, meaning they have longer widths and shorter heights. In other words, phones have shorter widths and longer heights. For phones, their natural orientation is often portrait. Natural orientation is defined as the display orientation when the device is in the position it is normally expected to be in. All about orientations Natural Orientation In addition, all photos below are simulated to make illustrations visually clearer. To make things a bit simpler, assume all examples involve a rear-facing camera unless otherwise mentioned. This document is meant to demonstrate how developers can navigate these and correctly handle camera orientations in Android apps. ![]() These factors combined introduce a large number of possible UI and preview configurations for camera apps. Viewfinder size: The size of the viewfinder used for displaying the camera preview.Display rotation: How much the device is physically rotated from the natural orientation.Sensor orientation: The orientation of the sensor physically mounted on the device.Natural orientation: The display orientation when the device is in the “normal” position for the device design - usually portrait orientation for mobile phones and landscape orientation for laptops.Handling orientations in Android camera apps is tricky and needs to take the following factors into consideration: We also recommend that you try writing a simple camera app first before approaching the article. You can read our blog post or summary for an overview of camera2. This article presumes you understand the basic concepts of Android camera2 API. ![]() If your Android app uses cameras, there are some special considerations when handling orientations. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |