Java tutorial
//package com.java2s; //License from project: Apache License import android.view.Surface; public class Main { private static String UNKNOWN = ""; /** * Returns the rotation of the screen from its "natural" orientation. * Notice: ANTICLOCKWISE * @param rotation "getRotation()" */ public static String getRotationStr(int rotation) { switch (rotation) { //Natural orientation case Surface.ROTATION_0://0 return "ROTATION_0"; case Surface.ROTATION_90://1 return "ROTATION_90"; case Surface.ROTATION_180://2 return "ROTATION_180"; case Surface.ROTATION_270://3 return "ROTATION_270"; default: return UNKNOWN; } } }