Java tutorial
//package com.java2s; import android.content.res.Resources; import android.util.TypedValue; public class Main { public static float getRawSize(Resources resources, int unit, float size) { return TypedValue.applyDimension(unit, size, resources.getDisplayMetrics()); } }