Java tutorial
//package com.java2s; //License from project: Apache License import android.content.res.Configuration; public class Main { private static String UNKNOWN = ""; /** * Constant for screenLayout: bits that encode the size. * @param sl_size_mask "screenLayout & SCREENLAYOUT_SIZE_MASK" */ public static String getSLSizeMaskStr(int sl_size_mask) { switch (sl_size_mask) { case Configuration.SCREENLAYOUT_SIZE_UNDEFINED://0 return "SCREENLAYOUT_SIZE_UNDEFINED"; case Configuration.SCREENLAYOUT_SIZE_SMALL://1 return "SCREENLAYOUT_SIZE_SMALL"; case Configuration.SCREENLAYOUT_SIZE_NORMAL://2 return "SCREENLAYOUT_SIZE_NORMAL"; case Configuration.SCREENLAYOUT_SIZE_LARGE://3 return "SCREENLAYOUT_SIZE_LARGE"; case Configuration.SCREENLAYOUT_SIZE_XLARGE://4 return "SCREENLAYOUT_SIZE_XLARGE"; default: return UNKNOWN; } } }