Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.res.Configuration; import android.view.WindowManager; public class Main { /** * Method getDeviceScreenHeight(). It's used for checking the screen's with * and To develop the functionality of horizontal direction or vertical * direction, we can used this for seperating the raised issues * * @return Integer Type. */ public static int getDeviceScreenHeight(Context context) { int height; WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); if (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { height = wm.getDefaultDisplay().getWidth(); } else { height = wm.getDefaultDisplay().getHeight(); } return height; } }