according to http://developer.android.com/training/multiscreen/screendensities.html
The following scale factors are mentioned
xhdpi: 2.0 hdpi: 1.5 mdpi: 1.0 (baseline) ldpi: 0.75
I was wondering what the scale factor would be for xxhdpi?
In android.util.DisplayMetrics, you can see that scaling factor is 0.00625:
/**
* Scaling factor to convert a density in DPI units to the density scale.
* @hide
*/
public static final float DENSITY_DEFAULT_SCALE = 1.0f / DENSITY_DEFAULT;
Where as DENSITY_DEFAULT is 160 --> scaling factor = 1.0f / 160 = 0.00625.
sizeScale = DENSITY_DEFAULT_SCALE * DENSITY_DPI
From this:
Not exactly a rocket science, but hope this will be useful for someone :)