Fragments vs. using ViewPager?

I have a question regarding the Android Support Libraries, Fragments, and as a specific example, the ViewPager class. My intention is to create an app with similar functionality to the sample provided on the Android Developer website ( or Looking into their code, I’ve noticed they utilize the library, which from my research is the only way to access the ViewPager class.

In my situation, I have no interest in backward compatibility. The minimum API level is 14 (Ice Cream Sandwich) and the build target is 4.2 Jelly Bean. In it’s simplest form, my app performs exactly as does the second demo I linked on the Android dev website – just swiping between three tabs with content in each.

  • Multiple TextViews update very slowly
  • Custom Listview Adapter with filter Android
  • How do I fire an event when click occurs outside a dialog
  • TextView gravity not working with Hebrew
  • How can a PreferenceActivity use a custom preference file
  • Upload progress bar in android?
  • All of the articles/posts/answers I’ve read seem to heavily favor the v4 support library. Now for my, albeit long-winded, question(s):

    1. What’s the best way to structure my application – using, and thereby using SupportFragments, or to use the Fragments provided in – and why?

    2. If Fragments from are the way to go, what is the optimal way to approach ViewPagers?

    3. If SupportFragments are best-suited to the task, I would estimate that they possess the same functionality as the other – so what’s the purpose of having them at all inside

    Hopefully someone with a clearer understanding can give me a bit of clarification because I’m boggled…

    Related posts:

    Cannot store emoji in database
    Selection Box around
    How to find out if an App has been moved to SD card on Android
    Android: decrypt RSA text using a Public key stored in a file
    How to get code coverage in Android using Maven (android-maven-plugin)
    SoapFault - faultcode: '1062' faultstring: 'Shipping method is not availa...
  • how to align item in table row (left - center - right)
  • Show decimal of a double only when needed
  • convert ArrayList<MyCustomClass> to JSONArray
  • java.lang.Void vs void vs Null
  • How can I setup Debug Certificate for Android ApkBuilder
  • Android IntentService Instantiation error
  • 2 Solutions collect form web for “ Fragments vs. using ViewPager?”

    You can use ViewPager with native fragments from the package with the adapters from the package. You have to use the v13 support jar for that.

    There are two versions of the adapters that work with ViewPager, the ones in the v4 package are meant to be used with support fragments, the ones in v13 with native fragments.

    The reason why there are now two fragment implementations is historical: Fragments in the package were introduced with Android 3 for tablets only and the support library was created to bring fragments to phones running older versions. On Android 4 you have both.

    From my own experience I would recommend using support fragments, even when developing for Android 4. Here are some reasons: Fragment or Support Fragment?

    If you’re going to target API 11+, you won’t need the support library [and your actual apk will be smaller, at least).

    If you want to support anything before Android 3.x, you’ll need the support library.

    Is this what you’re asking?

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.