Your Camera app on different form factors
summary
Camera sensor orientation can change with foldables and must be read dynamically from CameraCharacteristics (API 32+) rather than cached; Display.getRotation returns 0–3 which you convert to degrees by multiplying by 90. Preview rotation equals sensor orientation minus display rotation (adjust for front/back). Multi-window may require crop or scale to match aspect ratio, not just rotate. Jetpack CameraX auto-transforms previews; a new camera-viewfinder artifact works with Camera2 to handle orientation and sizing for you.
AI-written summary · about
chapters (5)
- 0:00Start
- 1:43Camera orientation
- 4:23Sensor orientation: 90 degrees
- 6:30Jetpack CameraX
- 8:23android dev summit


