title: Android WebView: Do CSS pixels always equal DIPs if width=device-width and scale=1.0?
body: <p>I'm trying to get my mind around how to specify CSS dimensions in an embedded WebView in my app for Android 4.0 and higher. On the three devices I'm testing with (Nexus 4/7/10), it appears that if I use the following viewport directive:</p>
  
  <pre><code>&lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"&gt;
  </code></pre>
  
  <p>...then any CSS dimensions in content loaded into that webview are exactly the same as device-independent pixels. That is to say, on my Nexus 10, which is 2560 physical pixels wide, if in my webview I specify something to have a width of 1280, it will exactly fill the width of the screen.</p>
  
  <p>I love the idea that I could use device-independent pixels in my CSS, but I need to ensure that I am able to calculate the precise available space in such DIPs. So I expect that if a WebView has, say, 1920 physical pixels in width, its width in CSS pixels should be:</p>
  
  <ul>
  <li>On an mdpi display, 1920px.</li>
  <li>On an hdpi display, 1280px.</li>
  <li>On an xhdpi display, 960px.</li>
  <li>On an xxhdpi display, 640px.</li>
  </ul>
  
  <p>Is this true?</p>