For the More Curious: Developing for Honeycomb, ICS, Jelly Bean, and Beyond

In this chapter, you learned how to use the support library to enable fragments for a project with a minimum SDK less than API level 11. However, if you were developing exclusively for newer SDKs, then you would not need to use the support library. Instead, you could use the native fragment classes in the standard library.

To use standard library fragments, you would make four changes to the project:

  • Set the application’s build target and minimum SDK to API level 11 or higher.

  • Subclass the standard library Activity class (android.app.Activity) instead of FragmentActivity. Activities have support for fragments out of the box on API level 11 or higher.

  • Subclass android.app.Fragment ...

Get Android Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.