Java tutorial
//package com.java2s; import android.app.Activity; import android.graphics.Point; import android.support.annotation.Nullable; import android.view.Display; public class Main { public static Point getScreenSize(@Nullable Activity activity) { Display display = activity.getWindowManager().getDefaultDisplay(); Point point = new Point(); display.getSize(point); return point; } }