Java tutorial
//package com.java2s; //License from project: LGPL import android.app.Activity; import android.util.DisplayMetrics; public class Main { public static int[] sizeScreen(Activity activity) { int[] size = new int[2]; DisplayMetrics dm = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(dm); size[0] = dm.widthPixels; size[1] = dm.heightPixels; return size; } }