You can retrieve the screen size using:
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
You will have to have decided which screen sizes are required for the different features, such as setting the minimum tablet height and width to min_tab_height
and min_tab_width
, accordingly. Then do a check for if this screen size qualifies:
boolean is_tablet = false;
if (width >= min_tab_width && height >= min_tab_height) {
is_tablet = true;
}
Now you can check if (is_tablet)
before allowing tablet functionality to your app (or if (!is_tablet)
for non-tablet functionality.