3

What's the difference between Screen Orientation and -Rotation on Android? The terms are often used interchangeably on the web it seems.

According to a discussion on the deprecation of Display.getOrientation() for getRotation() the concepts are often misunderstood/confused. No further explanation is provided however.

I suspect it's important to understand the intricacies of Orientation and Rotation on Android devices to correctly display an App even on exotic devices.

Joseph Tanenbaum
  • 2,211
  • 15
  • 30
  • They just can be used interchangeably. But the best one to use is getRotation if you check the documentation of android here http://developer.android.com/reference/android/view/Display.html#getOrientation() – TimVK May 16 '12 at 14:23

1 Answers1

4

At the link you gave Miss Dianne Hackborn clearly stated;

"getOrientation() has never returned orientation, it returns rotation. So it is being renamed to getRotation(). This is much less confusing. In fact you were confused -- you thought it returned orientation, when it does not."

To describe more deeply;

Gökhan Barış Aker
  • 4,445
  • 5
  • 25
  • 35
  • 2
    And this "natural" orientation (implied through the "natural" width and height) is available through getWindowManager().getDefaultDisplay().getMetrics(), as per http://stackoverflow.com/q/4553650/110597 – Joseph Tanenbaum May 16 '12 at 14:58