I have an emulator with a screen resolution of 720X1280 and a density of 320dpi.
Now, when I use the following code to find out dpheight, dpwidth and density
Display display = getWindowManager().getDefaultDisplay();
DisplayMetrics outMetrics = new DisplayMetrics();
display.getMetrics(outMetrics);
float density = getResources().getDisplayMetrics().density;
float dpHeight = outMetrics.heightPixels / density;
float dpWidth = outMetrics.widthPixels / density;
I get the following values:
06-24 06:47:46.027 D/Density ( 1003): 2.0
06-24 06:47:46.027 D/DPHeight( 1003): 592.0
06-24 06:47:46.027 D/DPWidth ( 1003): 360.0
I can't make sense of it. Can someone shade some light on it?
I intend to develop an app with loads of text, and I want to set the text sizes appropriately so that it looks consistent.
And yes, I have gone through Google's documentation regarding this.
But I couldn't understand, hence this question.