Java tutorial
//package com.java2s; import android.content.Context; import android.graphics.Point; import android.util.DisplayMetrics; public class Main { public static Point getScreenMetrics(Context context) { DisplayMetrics dm = context.getResources().getDisplayMetrics(); int w_screen = dm.widthPixels; int h_screen = dm.heightPixels; return new Point(w_screen, h_screen); } }