Android examples for User Interface:Screen Size
Get Screen Resolution
import android.content.Context; import android.util.DisplayMetrics; public class Main { public static String GetResolution(Context context) { DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); return displayMetrics.widthPixels + " * " + displayMetrics.heightPixels; }/*from ww w . j a v a2 s .c o m*/ }