Java tutorial
//package com.java2s; import android.app.Activity; import android.util.DisplayMetrics; public class Main { public static String getScreenParams(Activity activity) { DisplayMetrics dm = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(dm); return "&screen=" + (dm.heightPixels > dm.widthPixels ? dm.widthPixels + "*" + dm.heightPixels : dm.heightPixels + "*" + dm.widthPixels); } }