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 ...
随机推荐
- 什么是XAML?
XAML类似于XML一样的一种标记语言,主要用来设计UI. 对于XAML的历史,哪些都是废话了,至于Microsoft怎么整出XAML,然后,又怎么让XAML来开发windows 8应用程序,这些,都 ...
- 论坛类应用双Tableview翻页效果实现
作为一名篮球爱好者,经常使用虎扑体育,虎扑体育应用最核心的部分就是其论坛功能,无论哪个版块,论坛都是其核心,而其论坛部分的实现又别具一格,它以两个tableview的形式翻页滚动显示,而不是常见的那种 ...
- c# 重载运算符(+-|&)和扩展方法
通常我们需要对class的相加,相减,相乘 等重载以适应需求, 如caml查询的时候,我们可以定义一个caml类,然后来操作这些查询. 首先,我们定义一个class为Test public class ...
- RabbitMQ学习(1):安装
1.安装 Erlang,官网:https://www.erlang.org/ 2.安装RabbitMQ服务器,rabbitMQ server,官网http://www.rabbitmq.com/ 注: ...
- [C#]Linq To Xml 实例操作- 转
http://blog.sina.com.cn/s/blog_6c762bb301010oi5.html http://blog.xuite.net/cppbuilder/blog/9940157 在 ...
- 3563: DZY Loves Chinese - BZOJ
Description神校XJ之学霸兮,Dzy皇考曰JC.摄提贞于孟陬兮,惟庚寅Dzy以降.纷Dzy既有此内美兮,又重之以修能.遂降临于OI界,欲以神力而凌♂辱众生. 今Dzy有一魞歄图,其上有N座祭 ...
- SQL语言笔记
字符串用单引号',判断用单等号=,两个单引号''转义为一个单引号' 不等号是<> 不区分大小写 []括起来的要不是关键字,要不是非法变量,比如空格隔起来的变量 创建与删除数据库 - ...
- linux vi修改后如何保存
linux vi修改后如何保存 按ESC键去到命令模式,然后: :w?? 保存文件但不退出vi :w file 将修改另外保存到file中,不退出vi :w! 强制保存,不推出vi :wq 保存文件并 ...
- C/C++框架和库
http://blog.csdn.net/xiaoxiaoyeyaya/article/details/42541419 值得学习的C语言开源项目 - 1. Webbench Webbench是一个在 ...
- HDU 1753 大明A+B(字符串模拟,简单题)
简单题,但要考虑一些细节: 前导0不要,后导0不要,小数长度不一样时,有进位时,逆置处理输出 然后处理起来就比较麻烦了. 题目链接 我的代码纯模拟,把小数点前后分开来处理,写的很繁杂,纯当纪念——可怜 ...