Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.res.Resources; public class Main { /** * to get the screen's density * * @return */ public static float getDeviceDensity() { return Resources.getSystem().getDisplayMetrics().density; } }