title: Fragment vs Support Fragment when targeting api 21 (Android 5.0) and above
body: <p><a href="https://developer.android.com/about/dashboards/index.html" rel="nofollow noreferrer">Android dashboards</a> show that only half of devices have Android 5.0 and above, but numbers look different for our customer data set - it's over 93% of our users. So we've decided to abandon support for devices with Android version lower than 5.0 and change <code>minSdkVersion</code> from 15 to 21.</p>
  
  <p>This upgrade require from us to review all of obsolete functionalities and clean some hacky workarounds which we applied to support older versions. One of main functionality which we can apply now is to replace <code>android.support.v4.app.Fragment</code> with <code>android.app.Fragment</code>. It sounds like good idea, especially when we know that <a href="https://www.youtube.com/watch?v=k3IT-IJ0J98" rel="nofollow noreferrer">fragment API had been reviewed and improved</a>.</p>
  
  <p>Just to make sure that I’ll take right path and <code>android.app.fragment</code> won’t surprise me I would like to paraphrase question from this <a href="https://stackoverflow.com/questions/17295497/fragment-or-support-fragment">stackoverflow thread</a> - Are you using fragments from the support library, even though they are already available, when developing for Android 5? Are there any bugs in fragment API which occur on Android 5.0 and above and were fixed in support library?</p>
  
  <p><strong>Update</strong></p>
  
  <p>After Android-KTX release, <a href="https://github.com/android/android-ktx/pull/161#issuecomment-363270555" rel="nofollow noreferrer">Jake Wharton made the following statement in one of PRs</a>:</p>
  
  <blockquote>
    <p>Thanks for taking the time to make the PR (with tests!), but we would like to encourage that developers only use the support library fragments. <strong>The next version of Android will deprecate the version of fragments that are part of the platform.</strong> Thus, we aren't going to add any extensions to support them in this project.</p>
  </blockquote>
  
  <p>So using fragment from support library is the right thing to do.</p>