Java tutorial
//package com.java2s; import android.app.Activity; import android.util.DisplayMetrics; public class Main { public static String getScreenDimensionsString(Activity activity) { DisplayMetrics metrics = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(metrics); int h = metrics.heightPixels; int w = metrics.widthPixels; return w + "x" + h; } }