Here you can find the source of getSizeName(Context context)
static String getSizeName(Context context)
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.res.Configuration; public class Main { static String getSizeName(Context context) { int screenLayout = context.getResources().getConfiguration().screenLayout; screenLayout &= Configuration.SCREENLAYOUT_SIZE_MASK; switch (screenLayout) { case Configuration.SCREENLAYOUT_SIZE_SMALL: return "small"; case Configuration.SCREENLAYOUT_SIZE_NORMAL: return "normal"; case Configuration.SCREENLAYOUT_SIZE_LARGE: return "large"; case 4: // Configuration.SCREENLAYOUT_SIZE_XLARGE is API >= 9 return "xlarge"; default:// w w w . j av a 2s. c om return "undefined"; } } }