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.
Check with this code,
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int screenDensity = metrics.densityDpi;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With