Changing display orientations (on the Storm)
How to tell when the device is rotated
When the device orientation changes, layout is called with the new dimensions. The easiest way to determine the display has changed is to call Display.getWidth() and Display.getHeight() within layout ( or sublayout for Managers).
Forcing the display to rotate
I don't know of a way to force the display to rotate with the current API. It is possible to set the "acceptable" orientations of the device via net.rim.device.api.ui.UiEngineInstance.setAcceptableDirections(int directions), but those do not get checked until the device is rotated. This means that if the device was in the normal "portrait" orientation, it would stay in this orientation until the user rotated the device. When the user rotates the device, the acceptable directions are checked, and the device only rotates if the new orientation is acceptable.
