title: How to convert pixels to dp?
body: <p>I am trying to create a simple android app in Java but I have hit a bump in the road.</p>
  <p>I have an Array List that contains many Bitmaps and I am drawing them to the canvas but I am using the measurement of pixels and that doesn't come out right on most devices.</p>
  <p>So is there any way to find out the size of my Graphic in dp and scale it to the screen density/size with dp and position it with dp or dip.</p>
  <p>My Graphics ( Squares ) :</p>
  <blockquote>
  <p>Graphic size in ldpi =  50px</p>
  <p>Graphic size in mdpi =  75px</p>
  <p>Graphic size in hdpi = 100px</p>
  </blockquote>
  <p>Everyting else in the code is fine apart from it comes out looking weird?</p>
  <p>Any help would be appreciated.</p>
  <p>James.</p>