is Android 3 Tablet - Android Android OS

Android examples for Android OS:OS Version

Description

is Android 3 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 isAndroid_3_Tablet(Context context) {
        return isAndroid_3() && isTablet(context);
    }//ww  w. jav a2 s  . c o m

    public static boolean isAndroid_3() {
        int apiLevel = Build.VERSION.SDK_INT;
        if (apiLevel >= 11) {
            return true;
        }
        return false;
    }

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

Related Tutorials