Java tutorial
//package com.java2s; import android.annotation.TargetApi; import android.graphics.Point; import android.os.Build; import android.view.Display; public class Main { @TargetApi(Build.VERSION_CODES.KITKAT) public static int getWidthKitKat(Display display) { Point point = new Point(); display.getRealSize(point); return point.x; } }