title: display density and resources usage (ldpi/mdpi/hdpi/xhdpi)
body: <p>So I got HTC smartphone with 800x480 display. I always thought that it is HDPI device. And I was ensured using the following code:</p>
  
  <pre><code>Display display = activity.getWindowManager().getDefaultDisplay();
  DisplayMetrics displayMetrics = new DisplayMetrics();
  display.getMetrics(displayMetrics);
  displayDensity = displayMetrics.densityDpi;
  </code></pre>
  
  <p>it says my device is 240dpi. But experimentally I'd discovered that android threats my device only as MDPI. Im sure bout this. I tested the same with another 800x480 (ZTE) and result was the same - it shows 240 in displayDensity but android threats it as MDPI device... But why is it so? On android.devepoler they said that 240dpi is HDPI. I'm totally confused. Why the heck 240 is threated as MDPI? </p>
  
  <p><strong>How I'd discovered that android treats my HTC as MDPI device:</strong>
  In short what I made to ensure - I put a big image to drawable-hdpi (guessing AOS gonna use it) and smaller one to drawable-mdpi and than ran an app to see which it gonna use. And it always used image from drawable-mdpi instead of drawable-hdpi. To know how which image looks like on my device I ran app previously putting images to drawable folder of project.<br>
  However, like I mention above, I was guessing that my 800x480 HTC is HDPI due to code based on displayDensity but not on Configuration. Configuration says my device is Configuration.SCREENLAYOUT_SIZE_NORMAL and seems like thats the reason why AOS treats my device as MDPI only. So in conjunction with DisplayDensity of 240dpi (which must be HDPI instead of MDPI) it really frustrating. So now the question is why with Display density of 240dpi Configuration sets device to MDPI type? Whats the reason of this? I was thinking that the one and only way to detect the device type is its display density. And if it is 240dpi it must be HDPI device instead of MDPI.</p>