Java tutorial
//package com.java2s; import android.app.Activity; import android.graphics.Rect; import android.view.Window; public class Main { public static int getWindowHeight(Activity activity) { Rect out = new Rect(); activity.getWindow().findViewById(Window.ID_ANDROID_CONTENT).getHitRect(out); return out.height(); } }