Java tutorial
//package com.java2s; import android.annotation.TargetApi; import android.content.Context; import android.graphics.Point; import android.os.Build; import android.view.WindowManager; public class Main { @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) public static Point getDisplayInfo(Context ctx) { Point info = new Point(); WindowManager wm = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE); wm.getDefaultDisplay().getSize(info); ; return info; } }