Java tutorial
//package com.java2s; import android.app.Activity; import android.graphics.Point; import android.view.Display; public class Main { private static int width; private static int height; public static Point getDisplaySize(Activity activity) { Display display = activity.getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); width = size.x; height = size.y; return size; } }