Based on Aracem's answer, I updated the snippet with normal tablet check for 3.2 or higher (sw600dp):
public static boolean isTablet(Context context) {
try {
if (android.os.Build.VERSION.SDK_INT >= 13) { // Honeycomb 3.2
Configuration con = context.getResources().getConfiguration();
Field fSmallestScreenWidthDp = con.getClass().getDeclaredField("smallestScreenWidthDp");
return fSmallestScreenWidthDp.getInt(con) >= 600;
} else if (android.os.Build.VERSION.SDK_INT >= 11) { // Honeycomb 3.0
Configuration con = context.getResources().getConfiguration();
Method mIsLayoutSizeAtLeast = con.getClass().getMethod("isLayoutSizeAtLeast", int.class);
Boolean r = (Boolean) mIsLayoutSizeAtLeast.invoke(con, 0x00000004); // Configuration.SCREENLAYOUT_SIZE_XLARGE
return r;
}
} catch (Exception e) {
}
return false;
}