Java tutorial
//package com.java2s; //License from project: Apache License 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 screenWidth = dm.widthPixels; int screenHeight = dm.heightPixels; return new Point(screenWidth, screenHeight); } }