title: How to add screen layouts for different screen sizes in android? (Update 2020)
body: <p>I tested my application for screen sizes for 6 inches - 6.5 inches(on a one plus 6t/7t) and above and it's scaling the UI elements properly for it. But when I tested the application for screen sizes of 5 - 5.5inches, it's going out of the constraints and off the screen.</p>
  <p>These are the things that I have tried:</p>
  <ul>
  <li>Having <code>wrap_content</code> and <code>match_parent</code> with most of the UI elements(Textviews, Buttons to name a few)</li>
  <li>Using constraint_layout which is the default layout in Android Studio 3.0 with all the constraints set for every element</li>
  <li>I also tried understanding <a href="https://developer.android.com/training/multiscreen/screensizes" rel="nofollow noreferrer">this</a> document but I could not clearly understand this</li>
  </ul>
  <p>Lastly, I came across their solution of having a different screen layout for different screen size. For this, what would I have to do? Create a new Layout and copy my Design XML text in the newly created layout and adjust scaling accordingly or is there a better approach for doing so?</p>
  <p>Also, any other suggestions or any other approach to solve this would also help.</p>
  <p><strong>Edit 1:</strong></p>
  <p>So I figured something out, The UI is not setting correctly for xxhdpi resolutions. To compare, two screen sizes of similar sizes (1080x1920) having 420dpi and xxhdpi resolutions, the former works correctly but the latter does not. Any clues on how can I create or deal with xxhdpi resolutions?</p>