Why can smartphones automatically rotate the screen?
Short answer
Sensors detect whether the phone is being held upright or sideways, and the operating system uses that information to change the screen orientation.
How it works
An accelerometer measures acceleration caused by gravity and by the phone’s movement. Some devices also use a gyroscope, which measures changes in rotation.
The operating system interprets the sensor readings and offers portrait or landscape display to apps that support it. If orientation lock is on, or if an app does not support rotation, the display may stay in one direction.
Key point
The phone is not looking at the screen to decide its orientation. Software reads numbers from invisible sensors and changes the display based on those measurements.