Checks if the device is tablet or not. - Android Hardware

Android examples for Hardware:Device Feature

Description

Checks if the device is tablet or not.

Demo Code


//package com.java2s;
import android.content.Context;

public class Main {
    /**/*from   www. ja v a2  s .co m*/
     * Checks if the device is tablet or not.
     *
     * @param context
     * @return
     */
    public static boolean isTablet(Context context) {
        return context.getResources().getConfiguration().smallestScreenWidthDp >= 600;
    }
}

Related Tutorials