is Honeycomb Tablet - Android Hardware

Android examples for Hardware:Tablet

Description

is Honeycomb Tablet

Demo Code


//package com.java2s;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Build;

public class Main {
    public static boolean isHoneycombTablet(Context context) {
        return isHoneycomb() && isTablet(context);
    }//from   www  .j a v a 2 s. c o  m

    public static boolean isHoneycomb() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
    }

    public static boolean isTablet(Context context) {
        return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
    }
}

Related Tutorials