Android Support Library
title: Android Support Library
tags: Support Library,支持库
grammar_cjkRuby: true
---
DATE: 2016-5-13.
Support Library简介
Android Support Library(安卓支持库)是一系列代码库的集合,提供对早期Android 1.6+(API 4+)系统的兼容,并包含一些额外功能的API。每一个库针对不同的Android平台范围,并提供特定的功能集合。
Support Library特性
下面将介绍不同支持库所提供的主要功能和支持的安卓版本。通常,support v4 和 appcompat v7 包是推荐被包含到项目中,它们提供了最大范围的Android版本支持,包含了一些符合UI设计规范的API。
v4 Support Library
v4库被设计用来兼容Android 1.6(API 4)及以上的版本。相比其支持它库,它包含最多的API,包括程序兼容支持、可操作性、UI特性、数据绑定、网络连接、编程辅助工具类。
下面是一些关键的类:
程序组件
- Fragment
Static library support version of the framework's Fragment. Used to write apps that run on platforms prior to Android 3.0. When running on Android 3.0 or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework Fragment documentation for a class overview.
The main differences when using this support version instead of the framework version are:- Your activity must extend FragmentActivity
- You must call getSupportFragmentManager() to get the FragmentManager
- NotificationCompat
Helper for accessing features in Notification introduced after API level 4 in a backwards compatible fashion. - LocalBroadcastManager
Allows applications to easily register for and receive intents within a single application without broadcasting them globally.
UI控件类
- ViewPager:左右滑动切换的ViewGroup。
Adds a ViewGroup that manages the layout for the child views, which the user can swipe between. - PagerTitleStrip:ViewPager小圆点。
Adds a non-interactive title strip, that can be added as a child of ViewPager. - PagerTabStrip :页签。
Adds a navigation widget for switching between paged views, that can also be used with ViewPager. - 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 for AccessibilityEvent. For more information about implementing accessibility, see Accessibility.
- AccessibilityNodeInfoCompat - Adds support for AccessibilityNodeInfo.
- AccessibilityNodeProviderCompat - Adds support for AccessibilityNodeProvider.
- AccessibilityDelegateCompat - Adds support for View.AccessibilityDelegate.
数据操作
- Loader - Adds support for asynchronous loading of data. The library also provides concrete implementations of this class, including CursorLoader and AsyncTaskLoader.
- FileProvider - Adds support for sharing of private files between applications.
在开发文档API Reference中包android.support.v4下可以看到v4库完整的类、接口等。
v4库文件位于sdk目录<sdk>/extras/android/support/v4/
中,不包含UI资源(添加带资源的安卓库)。
使用v4库对应的Gradle依赖指令:com.android.support:support-v4:18.0.+
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系列库是针对API 7(Android 2.1)及以上系统的,v7系列包含多个独立的库,可根据它们的功能和项目需要分别引用。
v7 appcompat library兼容库
This library adds support for the Action Bar user interface design pattern.
为早先系统提供新版UI设计理念提出的Action Bar的支持,它依赖v4库。
下面列举v7兼容库的关键API:
- 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.
- ActionBarActivity - Adds an application activity class that must be used as a base class for activities that uses the Support Library action bar implementation.
- ShareActionProvider - Adds support for a standardized sharing action (such as email or posting to social applications) that can be included in an action bar.
v7 gridlayout library网格布局
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.
可以在包android.support.v7.widget下查看所有提供的API,GridLayout 不是适配器视图,不像GridView那样提供一致性的视图项目,可以灵活显示不同的内容,如Android中计算器布局。GridLayout 的继承层级较浅,性能比GridView好。
v7 mediarouter library
This library provides MediaRouter, MediaRouteProvider, and related media classes that support Google Cast.
v8 Support Library
引入:Render Script,在开发文档中“Develop > API Guides > Computation”中有详细介绍。
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.
Note: Use of RenderScript with the support library is supported with the Android Eclipse plugin and Ant build tools. It is not currently supported with Android Studio or Gradle-based builds.
v13 Support Library
Support classes to access some of the android.app package features introduced after API level 13 in a backwards compatible fashion.
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 the android.support.v13 package in the API reference.
参考文档
Android开发文档
- Develop > Tools > Support Library.
Android Support Library的更多相关文章
- Android Support Library介绍
v4 Support Library 这个库是为Android 1.6(API版本为4)及以上的版本设计的,它包含大部分高版本中有而低版本中没有的API,包括application component ...
- As环境下添加android support library依赖库
2015年的google大会上,google发布了新的Android Support Design库的新组件之一,以此来全面支持Material Design 设计风格的UI效果,为了可以使用这些新颖 ...
- [Xamarin.Android] Support Library Tips
[Xamarin.Android] Support Library Tips Support Library支持内容 Xamarin Support Library每个版本支持.那些组件,可以参考这份 ...
- eclipse创建android项目失败的问题 [ android support library ]
有根筋搭错了,想起来android应用开发???? 放下两年的手机应用开发,昨天有更新了android SDK, 重新搭建开发环境. 这两年android 变化真TM的大............... ...
- Android Support Library package简介
转自http://my.oschina.net/chengliqun/blog/148451 N久未做android了,以前做的时候,2.2才刚出来,现在android都更新到了4.3了,而从前一段时 ...
- Android Support Library更新到v22.1之AppCompat新特性
构建一个可以跑在不同版本 Android 平台的软件,是非常复杂和耗时的.为了解决这个问题,Android 推出了 Android Support Library (安卓兼容包),让新的UI控件也可以 ...
- Android - 用Fragments实现动态UI - 使用Android Support Library
Android Support Library提供了一个带有API库的JAR文件来让你可以在使用最新的Android API的同时也也已在早期版本的Android上运行.例如,Support Libr ...
- Android support library支持包常用控件介绍(二)
谷歌官方推出Material Design 设计理念已经有段时间了,为支持更方便的实现 Material Design设计效果,官方给出了Android support design library ...
- Android Support Library 是什么?
这两天刚开始学习安卓,这里记录下这两天遇到的一些小问题. 首先先贴一个安卓 API 等级. 官方地址:https://developer.android.com/about/dashboards/ ( ...
随机推荐
- windows下ThinkPHP3.2.3使用memcache缓存
准备 要使用memcache,首先要安装配置好memcache服务memcached: 下载http://downloads.northscale.com/memcached-win64-1.4.4- ...
- linux学习日记之老男孩
2016年10月5日企业面试题:cp 命令复制文件是如果有覆盖可能的话如何去除确认步骤,如:将/mnt/text.txt 复制 到/temp/text.txt,去除覆盖确认命令.方法:1.加全路径的c ...
- Blender 脚本之 Operator 初探
addon(插件)用来扩展 Blender 的功能,跟其他软件里的 plugin(插件)一样,去掉不会影响软件的运行.插件可以加到 Blender 的用户偏好设置目录里,或者就在你所编辑的.blend ...
- java web系统中时间比sql server中的日期少2天的解决办法
系统环境 jdk:1.7 数据库:sql server 2008 问题描述 升级1.7之后查询出来的日期就比数据库中的少2天,降回1.6版本的jdk就正常了. 问题原因及解决办法 国内网站有很多不靠谱 ...
- Javascript原型继承 __proto__
Javascript继承是通过原型链继承的 原型链是依赖__proto__而不是prototype var animal = function(){}; var dog = function(){}; ...
- Python 学习第十九天 django知识
一,django 知识总结 1,同一个name属性的标签,多个值获取 <form action="/login/" method="POST" encty ...
- python 处理视频输入输出
视频的处理和图片的处理类似,只不过视频处理需要连续处理一系列图片. 一般有两种视频源,一种是直接从硬盘加载视频,另一种是获取摄像头视频. 0x00. 本地读取视频 核心函数: cv.CaptureFr ...
- 判断是否安装APP
var time; $('#open').on('click',function(){ window.location="协议";//打开某手机上的某个app应用 time = s ...
- 通用js函数集锦<来源于网络/自己> 【一】
通用js函数集锦<来源于网络/自己>[一] 1.返回一个全地址2.cookie3.验证用户浏览器是否是微信浏览器4.验证用户浏览器是否是微博内置浏览器5.query string6.验证用 ...
- A*算法的原理 <转>
第一部分:A*算法简介 写这篇文章的初衷是应一个网友的要求,当然我也发现现在有关人工智能的中文站点实在太少,我在这里 抛砖引玉,希望大家都来热心的参与. 还是说正题,我先拿A*算法开刀, ...