Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;
import android.content.res.Configuration;

public class Main {
    /**
     * Determining the Screen's Size is xLarge and Landscape or not..
     * 
     * @param context
     *            The Application Context.
     * @return Boolean Type.
     */
    public static boolean isXLargeAndLandscape(Context context) {
        return isXLarge(context)
                && (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE);
    }

    /**
     * Determining the current screen's size is xlarge or not..
     * 
     * @param context
     *            The Application Context.
     * @return Boolean Type.
     */
    public static boolean isXLarge(Context context) {
        return ((context.getResources().getConfiguration().screenLayout
                & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE);
    }
}