How to get the density of a screen?

Viewed 14450

How to get density of a screen? I have tried with the following code. I got density as 1.0. I changed my emulator TO HVGA, QVGA and WVGA still I am getting the same result.

int density = getResources().getDisplayMetrics().density;

How to get actual density of my emulator screen.

4 Answers
Related