Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.res.Resources; import android.util.DisplayMetrics; public class Main { /** * get mobile screen resolution * * @param context * @return */ public static String getScreenResolution(Context context) { Resources resources = context.getResources(); DisplayMetrics metrics = resources.getDisplayMetrics(); return metrics.heightPixels + "x" + metrics.widthPixels; } /** get Resources */ public static Resources getResources(Context context) { return context.getResources(); } }