title: Android screen density calculation
body: <p>Can somebody tell me how Android counts the screen density?</p>
  
  <p>My problem is I have a device (ODYS Space) with 480x800 resolution and with 7" diagonal screen.
  If I calculate its density I get a value 133 DPI but Android (2.2 and 2.3 too) reports it like "MEDIUM" density device (160 DPI).</p>
  
  <p>I'm fighting with multiscreen support so I supposed 133 DPI will be rather reported like "LOW" than "MEDIUM" so now my screen layout looks quite stupid on this medium reported device.</p>
  
  <p>I check the device with code like this:</p>
  
  <pre><code>DisplayMetrics dMetrics = new DisplayMetrics(); 
  getWindowManager().getDefaultDisplay().getMetrics(dMetrics);  
  int d=dMetrics.densityDpi;
  </code></pre>
  
  <p>If I run that code on a virtual device configured (480x800/7" and 133 DPI) then I got density=120.</p>
  
  <p>On the real device why does it say 160 instead?</p>