Support Library官方教程(2)各支援包的特性详介(含表)*
1.各支援包简介表
包名 |
作用 | 位置 | 是否有资源 |
v4 |
提供了最多的api |
|
|
Multidex |
把DEX文件生成apk |
<sdk>/extras/android/support/multidex/ |
n |
v7 appcompat |
在v4上增加action bar,依赖 v4包 |
<sdk>/extras/android/support/v7/appcompat/ |
y |
v7 cardview |
CardView包 |
<sdk>/extras/android/support/v7/cardview/ |
y |
v7 gridlayout |
提供 GridLayout |
|
y |
v7 mediarouter |
提供对多媒体的控制 |
<sdk>/extras/android/support/v7/ |
y |
v7 palette |
提供调色板支持 |
<sdk>/extras/android/support/v7/palette/ |
n |
v7 recyclerview |
提供RecyclerView |
<sdk>/extras/android/support/v7/recyclerview/ |
y |
v7 Preference |
提供用户偏好设置类 |
<sdk>/extras/android/support/v7/ |
y |
v8 renderscript |
提供 renderscript |
build-tools/$VERSION/renderscript/ |
n |
v13 |
Fragment用户接口 |
<sdk>/extras/android/support/v13/ |
n |
v14 Preference |
增加用户偏好设置相关的类 |
<sdk>/extras/android/support/v14/ |
n |
v17 Preference tv |
主要提供 tv设备上的偏好设置类 |
<sdk>/extras/android/support/v17/ |
n |
v17 Leanback |
tv设备上的用户界面接口类 |
<sdk>/extras/android/support/v17/ |
y |
Annotations |
数据源 |
<sdk>/extras/android/support/annotations |
y |
Design |
设计包 |
<sdk>/extras/android/support/design |
y |
Custom Tabs |
自定义tab包 |
<sdk>/extras/android/support/customtabs |
y |
Percent Support |
|
y |
|
App Recommendation tv |
tv设置提供应用推荐包 |
|
y |
2.Support Library Features
The Android Support Library package contains several libraries that can be included in your application. Each of these libraries supports a specific range of Android platform versions and set of features.
每个support libary拥有不同特性。
This guide explains the important features and version support provided by the Support Libraries to help you decide which of them you should include in your application. In general, we recommend including the v4 support and v7 appcompat libraries, because they support a wide range of Android versions and provide APIs for recommended user interface patterns.
目前(2015)推荐使用v4 support and v7 appcompat 这两个系列支援包,它们的适用的api范围最广,提供了大量的用户界面接口。
In order to use any of the following libraries, you must download the library files to your Android SDK installation. Follow the directions for downloading the Support Libraries in Support Library Setup to complete this step. You must take additional steps to include a specific Support Library in your application. See the end of each library section below for important information on how to include the library in your application.
在项目中使用support libary要额外的步骤。
3.v4 Support Library (V4系列支援包)
This library is designed to be used with Android 1.6 (API level 4) and higher. It includes the largest set of APIs compared to the other libraries, including support for application components, user interface features, accessibility, data handling, network connectivity, and programming utilities. Here are a few of the key classes included in the v4 library:
v4 相比其它支援包,提供了最多的api。下面是v4中包含的重要api:
- App Components
Fragment
- Adds support for encapsulation of user interface and functionality with Fragments, enabling applications to provide layouts that adjust between small and large-screen devices.NotificationCompat
- Adds support for rich notification features.LocalBroadcastManager
- Allows applications to easily register for and receive intents within a single application without broadcasting them globally.
- User Interface
ViewPager
- Adds aViewGroup
that manages the layout for the child views, which the user can swipe between.PagerTitleStrip
- Adds a non-interactive title strip, that can be added as a child ofViewPager
.PagerTabStrip
- Adds a navigation widget for switching between paged views, that can also be used withViewPager
.DrawerLayout
- Adds support for creating a Navigation Drawer that can be pulled in from the edge of a window.SlidingPaneLayout
- Adds widget for creating linked summary and detail views that appropriately adapt to various screen sizes.
- Accessibility
ExploreByTouchHelper
- Adds a helper class for implementing accessibility support for custom views.AccessibilityEventCompat
- Adds support forAccessibilityEvent
. For more information about implementing accessibility, see Accessibility.AccessibilityNodeInfoCompat
- Adds support forAccessibilityNodeInfo
.AccessibilityNodeProviderCompat
- Adds support forAccessibilityNodeProvider
.AccessibilityDelegateCompat
- Adds support forView.AccessibilityDelegate
.
- Content
Loader
- Adds support for asynchronous loading of data. The library also provides concrete implementations of this class, includingCursorLoader
andAsyncTaskLoader
.FileProvider
- Adds support for sharing of private files between applications.
There are many other APIs included in this library. For complete, detailed information about the v4 Support Library APIs, see the android.support.v4
package in the API reference.
可通过下面链接 查看 android.support.v4 的详细api
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/v4/
directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for Adding libraries without resources.
Caution: Using dynamic dependencies, especially for higher version numbers, can cause unexpected version updates and regression incompatibilities.
The Gradle build script dependency identifier for this library is as follows:
以 Gradle脚本生成工程的项目 用下面方法添加 该lib
com.android.support:support-v4:23.1.0
4.Multidex Support Library
This library provides support for building apps with multiple Dalvik Executable (DEX) files. Apps that reference more than 65536 methods are required to use multidex configurations. For more information about using multidex, see Building Apps with Over 65K Methods.
这个库用来把DEX文件生成apk。 见 Building Apps with Over 65K Methods。
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/multidex/
directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for Adding libraries without resources.
下载后目录在 <sdk>/extras/android/support/multidex/ 下,该库没有用户界面资源。在gradle脚本中添加方法如下:
The Gradle build script dependency identifier for this library is as follows:
com.android.support:multidex:1.0.0
5.v7 Support Libraries(v7系列支援包)
There are several libraries designed to be used with Android 2.1 (API level 7) and higher. These libraries provide specific feature sets and can be included in your application independently from each other.
v7 支援包中包含了一系列包,按需求引用。下面介绍
5.1 v7 appcompat library
This library adds support for the Action Bar user interface design pattern. This library includes support for material design user interface implementations.
Note: This library depends on the v4 Support Library.
v7 compat包在v4基础上增加 action bar ,依赖 v4包,它包含的主要api如下:
Here are a few of the key classes included in the v7 appcompat library:
ActionBar
- Provides an implementation of the action bar user interface pattern. For more information on using the Action Bar, see the Action Bar developer guide.AppCompatActivity
- Adds an application activity class that can be used as a base class for activities that use the Support Library action bar implementation.AppCompatDialog
- Adds a dialog class that can be used as a base class for AppCompat themed dialogs.ShareActionProvider
- Adds support for a standardized sharing action (such as email or posting to social applications) that can be included in an action bar.
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/v7/appcompat/
directory. The library contains user interface resources. To include it in your application project, follow the instructions for Adding libraries with resources.
v7 compat 包在<sdk>/extras/android/support/v7/appcompat/ 下,它包含用户界面资源。在gradle中添加的方法如下:
The Gradle build script dependency identifier for this library is as follows:
com.android.support:appcompat-v7:23.1.
5.2 v7 cardview library
This library adds support for the CardView
widget, which lets you show information inside cards that have a consistent look on any app. These cards are useful for material design implementations, and are used extensively in layouts for TV apps.
v7 CardView包 包含控件 CardView。
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/v7/cardview/
directory. The library contains user interface resources. To include it in your application project, follow the instructions for Adding libraries with resources.
The Gradle build script dependency identifier for this library is as follows:
位置在 <sdk>/extras/android/support/v7/cardview/ 使用方法如下
com.android.support:cardview-v7:23.1.0
5.3 v7 gridlayout library
After you download the Android Support Libraries, this library adds support for the GridLayout
class, which allows you to arrange user interface elements using a grid of rectangular cells. For detailed information about the v7 gridlayout library APIs, see the android.support.v7.widget
package in the API reference.
v7 GridLayout 包提供 GridLayout
This library is located in the <sdk>/extras/android/support/v7/gridlayout/
directory . The library contains user interface resources. To include it in your application project, follow the instructions for Adding libraries with resources.
位置在 <sdk>/extras/android/support/v7/gridlayout/
,引用方法如下
The Gradle build script dependency identifier for this library is as follows:
com.android.support:gridlayout-v7:23.1.0
5.4 v7 mediarouter library
This library provides MediaRouter
, MediaRouteProvider
, and related media classes that support Google Cast.
In general, the APIs in the v7 mediarouter library provide a means of controlling the routing of media channels and streams from the current device to external screens, speakers, and other destination devices. The library includes APIs for publishing app-specific media route providers, for discovering and selecting destination devices, for checking media status, and more. For detailed information about the v7 mediarouter library APIs, see the android.support.v7.media
package in the API reference.
v7 mediarouter 提供对多媒体的控制
The v7 mediarouter library is located in the <sdk>/extras/android/support/v7/ mediarouter/
directory after you download the Android Support Library. It's provided as a library project with a dependency on the v7 appcompat library, so you'll need to include both libraries in your build path when setting up your project. For more information on how to set up your project, follow the instructions in Adding libraries with resources.
The Gradle builder script dependency identifier is as follows: com.android.support:support-v7-mediarouter:<revision>
, where "<revision>" is the minimum revision at which the library is available. For example:
位置在<sdk>/extras/android/support/v7/ 引用方法如下
com.android.support:mediarouter-v7:23.1.0
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 Google Cast.
5.5 v7 palette library
The v7 palette support library includes the Palette
class, which lets you extract prominent colors from an image. For example, a music app could use a Palette
object to extract the major colors from an album cover, and use those colors to build a color-coordinated song title card.
v7 palette 包提供调色板支持
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/v7/palette/
directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for Adding libraries without resources.
位置在<sdk>/extras/android/support/v7/palette/ 引用方法如下
The Gradle build script dependency identifier for this library is as follows:
com.android.support:palette-v7:23.1.0
5.6 v7 recyclerview library
The recyclerview library adds the RecyclerView
class. This class provides support for the RecyclerView widget, a view for efficiently displaying large data sets by providing a limited window of data items.
v7 recyclerview 包提供 RecyclerView
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/v7/recyclerview/
directory. The library contains user interface resources. To include it in your application project, follow the instructions for Adding libraries with resources.
位置在 <sdk>/extras/android/support/v7/recyclerview/ ,引用方法如下
The Gradle build script dependency identifier for this library is as follows:
com.android.support:recyclerview-v7:23.1.0
5.7 v7 Preference Support Library
The preference package provides APIs to support adding preference objects, such as CheckBoxPreference
and ListPreference
, for users to modify UI settings.
v7 preference包 提供 用户偏好设置类
The v7 Preference library adds support for interfaces, such as Preference.OnPreferenceChangeListener
and Preference.OnPreferenceClickListener
, and classes, such as CheckBoxPreference
and ListPreference
.
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/v7/ preference
directory. For more information on how to set up your project, follow the instructions in Adding libraries with resources.
位置在 <sdk>/extras/android/support/v7/ ,引用方法如下:
The Gradle build script dependency identifier for this library is as follows:
com.android.support:preference-v7:23.1.0
6. v8 Support Library(v8系列支援包)
This library is designed to be used with Android 2.2 (API level 8) and higher. This library provides specific feature sets and can be included in your application independently from other libraries.
6.1 v8 renderscript library
This library is designed to be used with Android (API level 8) and higher. It adds support for the RenderScript computation framework. These APIs are included in the android.support.v8.renderscript
package. You should be aware that the steps for including these APIs in your application is very different from other support library APIs. For more information about using these APIs in your application, see the RenderScript developer guide.
v8 renderscript包提供 renderscript ,相关资源 http://www.cnblogs.com/TerryBlog/archive/2012/03/02/2377251.html
Note: Use of RenderScript with the support library is supported with Android Studio and Gradle-based builds. The renderscript library is located in the build-tools/$VERSION/renderscript/
folder.
位置在build-tools/$VERSION/renderscript/,引用方法如下
The following example shows the Gradle build script properties for this library:
defaultConfig {
renderscriptTargetApi 18
renderscriptSupportModeEnabled true
}
6.v13 Support Library
This library is designed to be used for Android 3.2 (API level 13) and higher. It adds support for the Fragment user interface pattern with the (FragmentCompat
) class and additional fragment support classes. For more information about fragments, see the Fragments developer guide. For detailed information about the v13 Support Library APIs, see theandroid.support.v13
package in the API reference.
v13 包主要添加 Fragment用户接口的支持
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/v13/
directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for Adding libraries without resources.
位置在 <sdk>/extras/android/support/v13/,引用方法如下:
The Gradle build script dependency identifier for this library is as follows:
com.android.support:support-v13:23.1.0
8.v14 Preference Support Library
The android.support.v14.preference
package provides APIs to add support for preference interfaces such as PreferenceFragment.OnPreferenceStartFragmentCallback
and PreferenceFragment.OnPreferenceStartScreenCallback
, along with classes, such as MultiSelectListPreference
and PreferenceFragment
. For detailed information about the v14 Preference Support Library APIs, see the preference package in the API reference.
v14 Preference包主要增加用户偏好设置相关的类
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/v14/
directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for Adding libraries without resources.
位置在 <sdk>/extras/android/support/v14/ ,引用方法如下:
The Gradle build script dependency identifier for this library is as follows:
com.android.support:preference-v14:23.1.0
9.v17 Preference Support Library for TV
The android.support.v17.preference
package provides APIs for providing preference interfaces on TV devices, including support for the LeanbackListPreferenceDialogFragment.ViewHolder.OnItemClickListener
interface and classes, such as BaseLeanbackPreferenceFragment
and LeanbackPreferenceFragment
. For detailed information about the v17 Preference Support Library APIs, see the preference package in the API reference.
v17 Preference tv包主要提供 tv设备上的偏好设置类
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/v17/
directory. The library does not contain user interface resources. To include it in your application project, follow the instructions for Adding libraries without resources.
位置在 <sdk>/extras/android/support/v17/ ,引用方法如下:
The Gradle build script dependency identifier for this library is as follows:
com.android.support:preference-leanback-v17:23.1.0
10.v17 Leanback Library
The android.support.v17.leanback
package provides APIs to support building user interfaces on TV devices. It provides a number of important widgets for TV apps. Some of the notable classes include:
v17 Leanback包,主要提供tv设备上的用户界面接口类。主要的如下:
BrowseFragment
- A fragment for creating a primary layout for browsing categories and rows of media items.DetailsFragment
- A wrapper fragment for Leanback details screens.PlaybackOverlayFragment
- A subclass ofDetailsFragment
for displaying playback controls and related content.SearchFragment
- A fragment to handle searches. The fragment receives the user's search request and passes it to the application-providedSearchResultProvider
. TheSearchResultProvider
returns the search results to theSearchFragment
, which renders them into aRowsFragment
.
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/v17/leanback
directory. For more information on how to set up your project, follow the instructions in Adding libraries with resources.
位置在 <sdk>/extras/android/support/v17/leanback
,引用方法如下:
The Gradle build script dependency identifier for this library is as follows:
com.android.support:leanback-v17:23.1.0
11.Annotations Support Library
The Annotation package provides APIs to support adding annotation metadata to your apps.
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/annotations
directory. For more information on how to set up your project, follow the instructions in Adding libraries with resources.
annotation metadata包在 <sdk>/extras/android/support/annotations ,引用方法如下:
The Gradle build script dependency identifier for this library is as follows:
com.android.support:support-annotations:23.1.0
12.Design Support Library
The Design package provides APIs to support adding material design components and patterns to your apps.
The Design Support library adds support for various material design components and patterns for app developers to build upon, such as navigation drawers, floating action buttons (FAB), snackbars, and tabs.
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/design
directory. For more information on how to set up your project, follow the instructions in Adding libraries with resources.
design包位置在<sdk>/extras/android/support/design ,引用方法如下:
The Gradle build script dependency identifier for this library is as follows:
com.android.support:design:23.1.0
13.Custom Tabs Support Library
The Custom Tabs package provides APIs to support adding and managing custom tabs in your apps.
The Custom Tabs Support library adds support for various classes, such as Custom Tabs Service and Custom Tabs Callback.
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/customtabs
directory. For more information on how to set up your project, follow the instructions in Adding libraries with resources.
自定义tab包在<sdk>/extras/android/support/customtabs,引用方法如下:
The Gradle build script dependency identifier for this library is as follows:
com.android.support:customtabs:23.1.0
14.Percent Support Library
The Percent package provides APIs to support adding and managing percentage based dimensions in your app.
The Percent Support library adds support for the PercentLayoutHelper.PercentLayoutParams interface and various classes, such as PercentFrameLayout and PercentRelativeLayout.
百分比包 主要 提供PercentLayoutHelper.PercentLayoutParams系列类 ,位置在<sdk>/extras/android/support/percent
,引用方法如下:
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/percent
directory. For more information on how to set up your project, follow the instructions in Adding libraries with resources.
The Gradle build script dependency identifier for this library is as follows:
com.android.support:percent:23.1.0
15.App Recommendation Support Library for TV
The App Recommendation package provides APIs to support adding content recommendations in your app running on TV devices.
The App library adds support for annotations, such as ContentRecommendation.ContentMaturity and various classes, such as ContentRecommendation and RecommendationExtender.
为tv设置提供应用推荐包,主要包含ContentRecommendation.ContentMaturity,ContentRecommendation,RecommendationExtender等,位置在 <sdk>/extras/android/support/recommendation
,引用方法如下:
After you download the Android Support Libraries, this library is located in the <sdk>/extras/android/support/recommendation
directory. For more information on how to set up your project, follow the instructions in Adding libraries with resources.
The Gradle build script dependency identifier for this library is as follows:
com.android.support:recommendation:23.1.0
Support Library官方教程(2)各支援包的特性详介(含表)*的更多相关文章
- Support Library官方教程(3)android studio中导入支援包
Support Library Setup How you setup the Android Support Libraries in your development project depend ...
- Support Library官方教程(1)概述
Support Library The Android Support Library package is a set of code libraries that provide backward ...
- Android Support Library更新到v22.1之AppCompat新特性
构建一个可以跑在不同版本 Android 平台的软件,是非常复杂和耗时的.为了解决这个问题,Android 推出了 Android Support Library (安卓兼容包),让新的UI控件也可以 ...
- eclipse创建android项目失败的问题 [ android support library ]
有根筋搭错了,想起来android应用开发???? 放下两年的手机应用开发,昨天有更新了android SDK, 重新搭建开发环境. 这两年android 变化真TM的大............... ...
- Support Library(4)ecliplse导入支援包的方法
准备工作 下载支援包到本地.在 <sdk>/android-sdks/extras/android/support/v7 下包含两个目录「 m2repository,support 」 ...
- Android support library支持包常用控件介绍(一)
谷歌官方推出Material Design 设计理念已经有段时间了,为支持更方便的实现Material Design设计效果,官方给出了Android support design library 支 ...
- Android support library支持包常用控件介绍(二)
谷歌官方推出Material Design 设计理念已经有段时间了,为支持更方便的实现 Material Design设计效果,官方给出了Android support design library ...
- Android Studio:Support Library依赖包的版本号
当我们用RecyclerView时,如果想用某一个特定的版本,怎样才能知道版本号呢?如果自己的笔记本中用过这个库,那么会保存在本地硬盘中. Android自身依赖包的版本号本地存放路径: 没有用过该 ...
- DroidParts 中文系列教程(基于官方教程)
DroidParts中文系列教程(基于官方教程) (一)DroidParts框架概况 2014年4月18日星期五 11:36 他是一个精心构造的安卓框架,包括下面这些基本功能 DI依赖注入,可以注入V ...
随机推荐
- z470 装黑苹果 10.92
1.分两个区,一个是mac安装区,一个是镜像拷贝区. 2.把镜像压进去. 3.安装好系统. 4.把镜像区的 extent拷贝到安装好的系统盘里去. 5.安装驱动,网盘里有.还有系统也在网盘里. 6.声 ...
- Jira 6.0.3 安装与破解
如果你还没有使用Jira做项目跟踪与管理,那就赶紧试用一下吧.下面教你一步一步安装Jira 6.0.3,以及如何破解试用版. 一. 安装准备 1. 去Jira官方网站下载http://www.at ...
- Java中如何防止内存泄漏的发生
在Java开发中我们常常会遇到内存泄漏的情况发生.那么为什么会发生内存泄漏,以及怎样去防止! 内存泄漏的定义:对象已经没有被应用程序使用,但是垃圾回收器没办法移除它们,因为还在被引用着. 为什么会发生 ...
- OC内存管理 @property的增强
涉及到内存管理,只读,多线程等很多功能时,setter和getter方法也就没那么简单了:当然@property依然强大,很好用: 1:内存管理相关参数: *:retain: (如果是oc对象类型) ...
- nginx + tomcat集群和动静资源分离
开发的应用采用F5负载均衡交换机,F5将请求转发给5台hp unix服务器,每台服务器有多个webserver实例,对外提供web服务和socket等接口服务.之初,曾有个小小的疑问为何不采用开源的a ...
- Codeforces Beta Round #10 D. LCIS
题目链接: http://www.codeforces.com/contest/10/problem/D D. LCIS time limit per test:1 secondmemory limi ...
- JS打字效果的动态菜单代码分享
这篇文章主要介绍了JS打字效果的动态菜单,推荐给大家,有需要的小伙伴可以参考下. 这是一款基于javascript实现的打字效果的动态菜单特效代码,分享给大家学习学习. 小提示:浏览器中如果不能正常运 ...
- C#文件对话框,一次多选文件设置
OpenFileDialog ofd = new OpenFileDialog();ofd.Multiselect = true;if (ofd.ShowDialog() == DialogResul ...
- Emmet快速编写CSS样式
基本的CSS样式编写时,很多样式只需输入首字母即可得到不带属性值的CSS样式,像上面说到的margin. 1.而对于一些带有特定的属性值的CSS样式,只需输入CSS标签与属性值的首字母就可以,比如: ...
- Android Activity初探
原地址:Android Activity初探 Activity是一个应用中的组件,它为用户提供一个可视的界面,方便用户操作,比如说拔打电话.照相.发邮件或者是浏览地图等.每个activity会提供一个 ...