title: What is the Android equivalent of [UIScreen mainScreen].bounds.size.width?
body: <p>While we're at it, what is the Android equivalent of <code>[UIScreen mainScreen].scale</code>?</p>
  
  <p>Are the following equations correct?</p>
  
  <pre><code>[UIScreen mainScreen].bounds.size.width = displayMetrics.widthPixels
  [UIScreen mainScreen].scale = displayMetrics.density
  </code></pre>
  
  <p>where you get <code>displayMetrics</code> like so:</p>
  
  <pre><code>DisplayMetrics displayMetrics = new DisplayMetrics();
  Display display = ((WindowManager) someContext.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
  display.getMetrics(displayMetrics);
  </code></pre>
  
  <p>The thing is that I'm confused by the wording for iOS versus Android.</p>
  
  <p>The definitions for those UIScreen values are these:</p>
  
  <blockquote>
    <p><strong>bounds</strong></p>
    
    <p>Contains the bounding rectangle of the screen, measured in points.
    (read-only)</p>
    
    <p><strong>scale</strong></p>
    
    <p>The natural scale factor associated with the screen. (read-only)</p>
    
    <p>@property(nonatomic, readonly) CGFloat scale</p>
    
    <p>Discussion</p>
    
    <p>This value reflects the scale factor needed to convert from the
    default logical coordinate space into the device coordinate space of
    this screen. The default logical coordinate space is measured using
    points, where one point is approximately equal to 1/160th of an inch.
    If a device’s screen has a reasonably similar pixel density, the scale
    factor is typically set to 1.0 so that one point maps to one pixel.
    However, a screen with a significantly different pixel density may set
    this property to a higher value.</p>
  </blockquote>
  
  <p>I am wondering whether the width of the bounds is equivalent to the widthPixels of the DisplayMetrics and whether the scale value is equivalent to the density value on Android.</p>