Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.util.DisplayMetrics; public class Main { public static float getScreenDensity(Context context) { DisplayMetrics metrics = context.getApplicationContext().getResources().getDisplayMetrics(); return metrics.density; } }