Java tutorial
//package com.java2s; import android.annotation.TargetApi; import android.graphics.Point; import android.view.Display; public class Main { @TargetApi(23) private static void getDisplaySizeV23(Display display, Point outSize) { Display.Mode mode = display.getMode(); outSize.x = mode.getPhysicalWidth(); outSize.y = mode.getPhysicalHeight(); } }