For the first time to get my latest articles, please follow my official account:Technical team

The Android support library software has multiple libraries, each supporting a specific range of Android platform versions and features. Like more familiar v4, V7, V13, V14 and so on. What are the features that each library version is compatible with or brings with it?

V4 support library

The V4 library is intended to work with Android 2.3 (API level 9) and later. They contain the largest collection of apis compared to other support libraries, including support for application components, user interface functionality, accessibility, data processing, network connectivity, and programming utilities.

Note: Prior to the support library revision 24.2.0, a V4 support library existed. For efficiency, the library is split into modules. For backward compatibility, if you list support-V4 in your Gradle script, your APK will contain all V4 modules. However, to reduce the APK size, we recommend listing only the specific modules your application needs.

V4 compat library

This provides many framework API compatibility wrapper, such as Context. ObtainDrawable () and the performAccessibilityAction ()

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: support - compat: 24.2.0Copy the code

V4 core – utils library

Provides a number of utility classes, such as AsyncTaskLoader and PermissionChecker.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: support - core - utils: 24.2.0Copy the code

V4 core – UI library

Implement various UI-related components, such as ViewPager, NestedScrollView, and ExploreByTouchHelper.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: support - core - UI: 24.2.0Copy the code

V4 media – compat library

Migrate some media frameworks backwards, including MediaBrowser and MediaSession.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: support - media - compat: 24.2.0Copy the code

V4 fragment library

Add support for using fragments to encapsulate user interfaces and functionality, enabling applications to provide layouts that can be adjusted between large and small screen devices. This module relies on compat, core-utils, core-ui, and media-compat.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: support - fragments: 24.2.0Copy the code

Dalvik executable file subcontracting support library

This library provides support for developing applications using multiple Dalvik Executable (DEX) files. Applications that reference more than 65536 methods must use the Dalvik executable file subcontracting configuration. For more information on subcontracting using the Dalvik executable, see Developing applications with more than 64,000 methods.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: multidex: 1.0.0Copy the code

V7 support library

Some libraries are intended to work with Android 2.3 (API level 9) and later. These libraries provide a specific set of features and can be added to an application independently of other libraries.

V7 appcompat library

This library adds support for action bar user interface design patterns. This library contains support for Material Design user interface implementations.

Note: This library relies on the V4 support library.

Here are some key classes included in the V7 AppCompat library:

  • ActionBar – provides an implementation of the ActionBar user interface mode. For more information on using the action bar, see the Action bar developer’s guide.
  • AppCompatActivity – Add an application Activity class that can be used as a base class for activities implemented using the support library action bar.
  • AppCompatDialog – Add a dialog class that can be used as a base class for the AppCompat topic dialog.
  • ShareActionProvider – includes support for standardized sharing actions (such as emails or posts to social applications) that can be added to the action bar.

    The Gradle build script dependency identifier for this library looks like this:
    Com. Android. Support: appcompat - v7:24.2.0Copy the code

V7 cardview library

This library adds support for CardView widgets that allow you to display information within cards, giving your applications a consistent look and feel. These cards are very useful for Material Design implementations and are widely used in TV application layouts.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: cardview - v7:24.2.0Copy the code

V7 gridlayout library

When you download the Android support library, you can add support for the GridLayout class, which allows you to arrange user interface elements using mesh squares. To learn about the v7 gridlayout library API details, please refer to the API reference in android. Support. V7. The widget package.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: gridlayout - v7:24.2.0Copy the code

V7 mediarouter library

This library provides MediaRouter, MediaRouteProvider, and related media classes that support Google Cast.

In general, using apis in the V7 MediarOuter library, you can control the routing of media channels and streams from the current device to external screens, speakers, and other target devices. The library contains apis for publishing application-specific media routing providers, discovering and selecting target devices, and checking media status, among other things. For more information about the V7 Mediarouter library API, see the Android.support.v7.media package in the API Reference.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: mediarouter - v7:24.2.0Copy the code

The V7 MediarOuter library API introduced in the support library R18 may change in subsequent versions of the support library. For now, we recommend using only Google Cast-related libraries.

V7 palette library

The V7 Palette support library contains the Palette class, which allows you to extract highlight colors from images. For example, a music application can use the Palette object to extract the main colors from an album cover, and then use those colors to create a color-coordinated song title card.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: the palette - v7:24.2.0Copy the code

V7 recyclerview library

Recyclerview library added the RecyclerView class. This class can support the RecyclerView widget, a view that effectively displays large data sets by providing a limited window of data items.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: recyclerview - v7:24.2.0Copy the code

####v7 Preference support library preferences the API provided by the software package supports adding Preference objects, such as CheckBoxPreference and ListPreference, to facilitate user modification of UI Settings.

V7 Preference library has added to the interface (such as Preference. OnPreferenceChangeListener and Preference. OnPreferenceClickListener) and class (for example CheckBoxPreference and ListPreference).

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: preference - v7:24.2.0Copy the code

V8 support library

This library is intended to work with Android 2.3 (API level 9) and later. This library provides a specific set of features and can be added to an application independently of other libraries.

V8 renderscript library

This library is intended to work with Android 2.3 (API level 9) and later. It adds support for the RenderScript computing framework. Android. Support. V8. Renderscript package containing these apis. Note that the steps for adding these apis to your application are very different from adding other support library apis. For more information on using these apis in your application, see the RenderScript Developer’s Guide.

Note: Android Studio and Gradle builds support RenderScript with support libraries. Renderscript libraries are located in the build-tools/$VERSION/ renderScript/folder.

The following example shows the Gradle build script properties for this library:

defaultConfig {
    renderscriptTargetApi 18
    renderscriptSupportModeEnabled true
}Copy the code

V13 support library

This library is intended for Android 3.2 (API level 13) and later. It adds support for Fragment user interface patterns with (FragmentCompat) classes and other Fragment support classes. For more information about fragments, see the Fragment Developer’s Guide. For more information about the V13 support library API, see the Android.support. v13 package in THE API Reference.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: support - v13:24.2.0Copy the code

V14 Preference support library

Android. Support. V14. Preference packages provide API is added to the preferences interface (for example PreferenceFragment OnPreferenceStartFragmentCallback and PreferenceFragment. OnPreferenceStartScreenCallback) and class (such as MultiSelectListPreference and PreferenceFragment) support. For more information about the V14 Preference support library API, see Preference Packages in the API Reference.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: preference - v14:24.2.0Copy the code

V17 Preference support library for TVS

Android. Support. V17. Preference packages offer apis can provide preference on television equipment interface, Including LeanbackListPreferenceDialogFragment. ViewHolder. OnItemClickListener interfaces and classes, Such as BaseLeanbackPreferenceFragment and LeanbackPreferenceFragment. For more information about the V17 Preference support library API, see Preference Packages in the API Reference.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: preference - leanback - v17:24.2.0Copy the code

V17 Leanback library

Android. Support. V17. Leanback API support provided by the package on television equipment to build the user interface. It provides some important widgets for TV applications. Some notable classes include:

  • BrowseFragment – A fragment used to create the main layout for browsing categories and media items.
  • DetailsFragment – Wrapper fragment for Leanback detail screen.
  • PlaybackOverlayFragment – A DetailsFragment subclass that displays playback controls and related content.
  • SearchFragment – Fragments used to process searches. Fragments can receive a user’s search request and pass it to the SearchResultProvider provided by the application. The SearchResultProvider returns search results to the SearchFragment, which renders the results into the RowsFragment.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: leanback - v17:24.2.0Copy the code

Annotation Support library

Annotation packages provide apis that support adding annotation metadata to applications.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: support - annotations: 24.2.0Copy the code

Design Support Library

The API provided by the Design package enables you to add Material Design components and patterns to your application.

The Design support library adds support for various Material Design components and patterns that application developers rely on, such as drawer navigation, floating action buttons (FAB), shortcut message bars, and tabs.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: design: 24.2.0Copy the code

Custom TAB page support library

User-defined tags Software packages provide apis for adding custom tags to applications and managing them.

The custom TAB page support library adds support for various classes such as custom TAB page services and custom TAB page callbacks.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: customtabs: 24.2.0Copy the code

Percentage support library

Percentage packages provide apis that allow you to add and manage percent-based dimensions to your application.

Support library percentage added to PercentLayoutHelper. PercentLayoutParams interface and the support of various classes, such as PercentFrameLayout and PercentRelativeLayout.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: percent: 24.2.0Copy the code

Suggested application support library for TV

Application Suggestions The API provided by the package supports adding content suggestions to applications running on TV devices.

Application library added annotations (such as ContentRecommendation. ContentMaturity and various classes (for example ContentRecommendation and RecommendationExtender) support.

The Gradle build script dependency identifier for this library looks like this:

Com. Android. Support: recommendation: 24.2.0Copy the code

After reading the above introduction, you have a more comprehensive understanding of Google’s Support libraries and the differences between versions. If you want to share it, let more people know.

For the first time to get my latest articles, please follow my official account:Technical team