title: Is there any difference between "TypedValue.COMPLEX_UNIT_DIP" and "dp in xml"?
body: <p>In my App I am specifying the width of a few elements dynamically using </p>
  
  <pre><code>TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5, mycontext.getResources().getDisplayMetrics());
  </code></pre>
  
  <p>I am also using some other elements whose width are specified in the layout xml in dp terms.</p>
  
  <p>However when I run the app on my Samsung Galaxy Grand, I observe that 100 dip specifed dynamically is not exactly equal to 100 dp specified in the layout xml(slightly more).</p>
  
  <p>However, when I test it on a AVD it appears to be fine(both width matches).</p>
  
  <p>Has anyone else encountered this issue as well?
  Any Idea? </p>