title: Understanding Samsung Galaxy Tab screen density
body: <p>One would say that if the Galaxy Tab screen resolution (in portrait mode) is <code>600px</code> and the screen width is <code>3.55inch</code>, the screen density would be <code>600/3.55 = 169 dpi</code>. Knowing that and keeping in mind the way the device independent pixels (dp) is computed (<a href="http://developer.android.com/guide/practices/screens_support.html" rel="nofollow noreferrer">http://developer.android.com/guide/practices/screens_support.html</a>):</p>
  
  <pre><code>px = dp * (dpi / 160);
  600 = dp * (169 / 160);
  dip = 568
  </code></pre>
  
  <p>So drawing a horizontal line of 568dp (device independent pixels) width starting at position 0 must exactly match the width of the screen. But if you try this on device you will find that the screen width is <code>400dp</code>. I will use the same formula again but for getting dpi:</p>
  
  <pre><code>600 = 400 * (dpi / 160);
  dpi = 240
  </code></pre>
  
  <p>So having the <code>240dpi</code>, <code>3.55inch</code> screen width and <code>600pixels</code>, does it mean that one physical pixel is composed of more ‘dots’ otherwise the parameters corresponds to the width of <code>852pixel (3.55*240)</code>.</p>
  
  <p>I thought that dpi means dots per inch, which is pixels per inch. But this seems to not be true...</p>
  
  <p><strong>Added later:</strong><br>
  This (<a href="http://developer.android.com/guide/topics/resources/more-resources.html#Dimension" rel="nofollow noreferrer">http://developer.android.com/guide/topics/resources/more-resources.html#Dimension</a>) says: </p>
  
  <blockquote>
    <p>160dp is always one inch regardless of the screen density</p>
  </blockquote>
  
  <p>Which is not true. Just check the measurement source from this:
  <a href="https://stackoverflow.com/questions/6656651/difference-between-android-dimension-pt-and-dp/7049678#7049678">Difference between android dimension: pt and dp</a></p>
  
  <p><strong>Added even later:</strong><br>
  The reason I am asking is that violating the rule that <code>160dp = 1inch</code> leads to the fact that when specifying the control width to e.g. 320dp it will cover on Galaxy Tab much bigger portion that that really necessary and much bigger then what you would expect from 600x1024px screen...</p>
  
  <p>Thanks for clarification
  BR
  STeN</p>