we can use DisplayMetrics.densityDpi to obtain a approximate dpi value of the device,but i eager to know how to obtain the exact dpi value?
Use DisplayMatrics.xdpi and DisplayMatrics.ydpi
xdpi The exact physical pixels per inch of the screen in the X dimension.
ydpi The exact physical pixels per inch of the screen in the Y dimension.
getResources().getDisplayMetrics().xdpi
getResources().getDisplayMetrics().ydpi
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