Support Library

The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level. This design means that your applications can use the libraries' features and still be compatible with devices running Android 1.6 (API level 4) and up.

This guide provides information about what features are enabled by the Support Libraries, how to use them in your development environment and information about library releases.

Overview

Including the Support Libraries in your Android project is considered a best practice for application developers, depending on the range of platform versions your app is targeting and the APIs that it uses. Using the features the libraries provide can help you improve the look of your application, increase performance and broaden the reach of your application to more users. If you use the Android code template tools, you will notice that all the Android application templates include one or more of the Support Libraries by default.

The Support Libraries each target a base Android API level and each provides a different set of features. In order to effectively use the libraries, it is important to consider what features you want to support and understand what features are supported by each library at what Android API level. To get started, review the Support Library Features guide. After that, go to the Support Library Setup topic to learn how to incorporate the Support Libraries into your application. For more details about Support Library APIs, see the android.support packages in the API reference.

Revisions

This section provides details about the Support Library package releases.

Android Support Library, revision 20 (July 2014)

Changes for v4 support library:

Android Support Library, revision 19.1.0 (March 2014)

Changes for v4 support library:
  • Added the SwipeRefreshLayout class, which enables users to refresh the contents of a view with a vertical swipe gesture.
  • Fixed accessibility issues with navigation drawers.
Changes for v7 appcompat library:
  • Fixed background issues with the action bar.

Android Support Library, revision 19.0.1 (December 2013)

Changes for v4 support library:
Changes for v7 mediarouter library:
Changes for v8 renderscript library:
  • Added error propagation for the RenderScript thunking layer.

Android Support Library, revision 19 (October 2013)

Changes for v4 support library:
Changes for v7 mediarouter library:
  • Added support for media playback queuing, setting HTTP header values and media playback duration.
  • Added explicit start, get, and end session actions for explicitly managing media playback sessions with media router.

Android Support Library, revision 18 (July 2013)

Changes for v4 support library:
New v7 appcompat library:
  • Added ActionBar to allow implementation of the action bar user interface design pattern back to Android 2.1 (API level 7) and higher. Use of this class requires that you implement your activity by extending the new ActionBarActivity class.
New v7 mediarouter library:

Added a new mediarouter library that provides support for the Google Cast developer preview. The v7 mediarouter library APIs provide a means of controlling the routing of media channels and streams from the current device to external screens, speakers, and other destination devices, with compatibility back to Android 2.1 (API level 7). See V7 mediarouter library for more information.

The v7 mediarouter library APIs introduced in Support Library r18 are subject to change in later revisions of the Support Library. At this time, we recommend using the library only in connection with the Google Cast developer preview.

Android Support Library, revision 13 (May 2013)

Changes for v4 support library:
New v7 gridlayout library:

Android Support Library, revision 12 (February 2013)

Changes for v4 support library:
  • Improved interaction behavior for ViewPager.
  • Fixed a bug that could cause ViewPager to select the wrong page.
  • Fixed use of removeView() method during layout for ViewPager.
  • Fixed issue with SearchViewCompat where using the back button to dismiss does not clear the search text. This fix only applies to host API levels 14 and higher.

Android Support Library, revision 11 (November 2012)

Changes for v4 support library:

Android Support Library, revision 10 (August 2012)

Changes for v4 support library:
  • Added support for notification features introduced in Android 4.1 (API level 16) with additions to NotificationCompat.

Android Support Library, revision 9 (June 2012)

Changes for v4 support library:

Android Support Library, revision 8 (April 2012)

Changes for v4 support library:
  • Fixed intent flags for PendingIntent objects generated by TaskStackBuilder.
  • Removed unused attributes from the gridlayout library projects to make sure the library can be built with API level 7 and higher.
  • Added .classpath and .project files for the gridlayout library project.

Android Support Library, revision 7 (March 2012)

Changes for v4 support library:
  • Added ShareCompat, which provides helper classes for sending and receiving content for social sharing applications, including new metadata for attributing shared data to the source app. This class also provides compatible integration with the new ShareActionProvider in Android 4.0.
  • Added NavUtils and TaskStackBuilder to provide support for implementing the Android Design guidelines for navigation. These additions include a way to implement the action bar's Up button across versions. For an example implementation of this pattern, see the AppNavigation sample in (<sdk>/samples/<platform>/AppNavigation).
  • Added NotificationCompat.Builder to provide a compatibility implementation of Android 3.0's Notification.Builder helper class for creating standardized system notifications.

Android Support Library, revision 6 (December 2011)

Note: Reference for support library APIs are now available with the framework references, for example: android.support.v4.app.

Changes for v4 support library:
  • Changes to ViewPager:
    • Added extra decorative view support for ViewPager. Decorative views may be supplied as child views of a pager in XML layout.
    • Added PagerAdapter.getPageTitle() to supply title strings for pages, which defaults to no title for each page.
    • Added PagerTitleStrip, a non-interactive title strip, that can be added as a child of ViewPager. Developers can supply text appearance and color, as well as layout sizing and gravity information.
    • Updated PagerAdapter methods to take ViewGroup objects, rather than View to avoid class casting in adapter implementations.
    • Updated ViewPager to use Launcher-style fling behavior.
    • Bug fixes for user interface interaction and test automation.
  • Support for Fragments:
  • Support for Accessiblity APIs:

Android Support Library, revision 5 (December 2011)

Changes for v4 support library:

Android Support Library, revision 4 (October 2011)

Changes for v4 support library:
  • Added EdgeEffectCompat to support EdgeEffect.
  • Added LocalBroadcastManager to allow applications to easily register for and receive intents within a single application without broadcasting them globally.
  • Added support in ViewCompat to check for and set overscroll modes for Views on Android 2.3 and later.
  • Changes to Fragment APIs:
    • Added new APIs to control the visibility of new menus.
    • Added custom animation APIs.
    • Added APIs in FragmentActivity to retain custom, non-configuration instance data.
    • Various bug fixes.
  • Fixed a Loader bug that caused issues in canceling AsyncTasks when running on Froyo and older versions of the platform. The support code now uses its own version of AsyncTask to keep the same behavior on all platform versions.

Android Support Library, revision 3 (July 2011)

Changes for v4 support library:
  • Adds support for Fragment.SavedState
  • Adds MotionEventCompat to support newer MotionEvent APIs
  • Adds VelocityTrackerCompat to support a newer VelocityTracker APIs
  • Adds ViewConfigurationCompat to support a newer ViewConfiguration APIs
  • All new APIs (available only in the support library) that allow you to create UIs with horizontal paging, allowing users to swipe left and right between content views. Classes to support this include:
    • ViewPager: A ViewGroup that manages the layout for the child views, which the user can swipe between.
    • PagerAdapter: An adapter that populates the ViewPager with the views that represent each page.
    • FragmentPagerAdapter: An extension of PagerAdapter for flipping between fragments.
    • FragmentStatePagerAdapter: An extension of PagerAdapter for flipping between fragments that uses the library's support for Fragment.SavedState.
New v13 support library:
  • Includes the FragmentPagerAdapter and FragmentStatePagerAdapter to support the horizontal paging.

    These are exactly the same as the APIs added to the v4 support library, but rely on other platform components in Android 3.2. Use this library instead of v4 if you're developing for Android 3.2 and higher (all other APIs in the v4 library are already available with API level 13).

Android Support Library, revision 2 (May 2011)

Changes for v4 library:

Android Support Library, revision 1 (March 2011)

Initial release with the v4 library.