Here you can find the source of isTabletDevice(Display d, Activity context)
public static boolean isTabletDevice(Display d, Activity context)
//package com.java2s; /**/*from w w w . j a v a 2s . com*/ * Copyright (c) 2012 Acrylic Goat Software * * This software is subject to the provisions of the GNU Lesser General * Public License Version 3 (LGPL). See LICENSE.txt for details. */ import android.app.Activity; import android.util.Log; import android.view.Display; public class Main { public static boolean isTabletDevice(Display d, Activity context) { if (android.os.Build.VERSION.SDK_INT >= 11) { // honeycomb if (d.getWidth() < d.getHeight()) { //is portrait so return false return false; } else { //landscape so check width int w = d.getWidth(); Log.d("DDGUtil", "width = " + w); if (w >= 900) { return true; } else { return false; } } } return false; } }