Android Utililty Methods Tablet Check

List of utility methods to do Tablet Check

Description

The list of methods to do Tablet Check are organized into topic(s).

Method

booleanisTablet(Configuration configuration)
is Tablet
int cur = configuration.screenLayout
        & Configuration.SCREENLAYOUT_SIZE_MASK;
if (cur == Configuration.SCREENLAYOUT_SIZE_UNDEFINED)
    return false;
return cur >= Configuration.SCREENLAYOUT_SIZE_LARGE;
booleanisTabletDevice(Display d, Activity context)
is Tablet Device
if (android.os.Build.VERSION.SDK_INT >= 11) { 
    if (d.getWidth() < d.getHeight()) {
        return false;
    } else {
        int w = d.getWidth();
        Log.d("DDGUtil", "width = " + w);
        if (w >= 900) {
            return true;
...
booleanisTablet(Context context)
public static boolean isTablet(Context context){ this method will return true if device is tab else it will return false
TelephonyManager _manager = (TelephonyManager) context
        .getSystemService(Context.TELEPHONY_SERVICE);
if (_manager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE) {
    return true;
} else {
    return false;
booleanisTabletDevice(Context activityContext)
public static boolean isTabletDevice(Context activityContext)

Checks if the device is a tablet or a phone on the basis of density and display
boolean xlarge = ((activityContext.getResources()
        .getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE);
if (xlarge) {
    DisplayMetrics metrics = new DisplayMetrics();
    Activity activity = (Activity) activityContext;
    activity.getWindowManager().getDefaultDisplay()
            .getMetrics(metrics);
    if (metrics.densityDpi == DisplayMetrics.DENSITY_DEFAULT
...