Rotational Forces, Part Five
In past posts in the Rotational Forces series, we have seen how to have your activity react to screen rotations, as well as how to force your activity to remain in one orientation (e.g., portrait).
However, we haven’t covered the iPhone Scenario.
You may have seen one (or several) commercials for the iPhone, showing how the screen rotates just by turning the device. By default, you do not get this behavior with the T-Mobile G1 — instead, the screen rotates based on whether the keyboard is open or closed.
However, it is very easy for you to change this behavior, so your screen will rotate based on the position of the phone: just add android:screenOrientation=”sensor” to your AndroidManifest.xml file:
The “sensor”, in this case, tells Android you want the accelerometers to control the screen orientation, so the physical shift in the device orientation controls the screen orientation.
At least on the G1, this appears to only work when going from the traditional upright portrait position to the traditional landscape position — rotating 90 degrees counter-clockwise. Rotating the device 90 degrees clockwise results in no change in the screen.
Also note that this setting disables having the keyboard trigger a rotation event. Leaving the device in the portrait position, if you slide out the keyboard, in a “normal” Android activity, the screen will rotate; in a android:screenOrientation=”sensor” activity, the screen will not rotate.
You might also like
A few days ago, we showed you the first leaked render images of LG Spectrum, the rumored successor to the LG Revolution. Well, the leaked shots weren’t very clear, and we
The full list of specs for the Droid Devour from Motorola have unearthed and they are remarkably unremarkable.Â On paper, the next Android-based handset from Verizon looks much like the
Expected over the next few weeks, the arrival of the myTouch HD is fast approaching. That means we’re in that interesting runup period where handsets tend to trickle into the wild and get pictured and benchmarked.