Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.res.Configuration; import android.os.Build; public class Main { private static boolean isHoneycombTablet(Context context) { return isHoneycomb() && isTablet(context); } private static boolean isHoneycomb() { // Can use static final constants like HONEYCOMB, declared in later // versions // of the OS since they are inlined at compile time. This is guaranteed // behavior. return Build.VERSION.SDK_INT >= 11; } private static boolean isTablet(Context context) { return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE; } }