I am working on an Android application and I try to understand which DPI is my display. The vendor said is an HDPI display but I get a complete different result. This is my code:
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
String text = "Width: " + metrics.widthPixels
+ "\nHeight: " + metrics.heightPixels
+ "\nDpi: " + metrics.densityDpi
+ "\nXDPI: " + metrics.xdpi
+ "\nYDPI: " + metrics.ydpi
+ "\nRDpi: " + (int)(metrics.density * 160f);
And the device print the following information:
Width: 320
Height: 320
Dpi: 160
XDPI: 262
YDPI: 262
RDPI: 160
So it seems that the vendor consider XDPI and XDPI the parameters to state that the display is an HDPI but in reality it is an MDPI. Am I wrong?