【翻译】Android Support Library Features(二)

原文地址:http://developer.android.com/tools/support-library/features.html

在Android Support Library包中,包含了几个可以被引入到你应用的库。每一个库支持一个特定的Android平台版本范围和功能集合。

原文: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 Library提供的重要功能和版本,这将帮助你决定你的应用选择哪一个功能和版本。总的来说,我们推荐引入v4 support v7 appcompat的库,因为它们支持的Android版本很广泛,并为推荐的用户界面样式提供API。

原文: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.


想要使用任何下面的库,你必须将库文件下载到你安装的Android SDK中。在Support Library Setup中根据指引下载Support Library,来完成这一步骤。你必须采取额外的措施来引入一个特殊的Support Library到你的应用中。查看下面每一个库章节的末尾来获取重要信息,这些信息阐述了如何将库引入你的应用中。

原文: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.


v4 Support Library


这个库是为Android 1.6(API level 4)和更高版本设计的。相对于其他库,他包含的API集合最大,包括对应用组件、用户界面功能、辅助功能、数据处理、网络连接和编程工具的支持。这里有一些包含在v4库中的关键类:(此处偷个懒,省去关键类的翻译500字^_^)

原文: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:


  • App Components
    • Fragment - Adds support encapsulation of user interface and functionality with Fragments, enabling applications 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 a ViewGroup 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 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.
  • Content
    • 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包含在这个库中。在API引用中查看 android.support.v4包,以获取关于v4 Support Library API的全部和详细的信息。

原文: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 Library以后,这个库放在/extras/android/support/v4/目录下。这个库不包含用户界面资源。按照adding libraries without resources的说明来将这个库引入你的应用项目。

原文:This library is located in the /extras/android/support/v4/ directory after you download the Android Support Libraries. This library does not contain user interface resources. To include it in your application project, follow the instructions for adding libraries without resources.


这个库的Gradle建造脚本依赖标识符如下:
原文:The Gradle build script dependency identifier for this library is as follows:

com.android.support:support-v4:18.0.+

这个依赖符号指定了发布版本为18.0.0或更高。
原文:This dependency notation specifies the release version 18.0.0 or higher.

v7 Libraries 


有几个库是为Android 2.1(API level 7)和更高版本设计的。这些库提供指定的功能集合,并且可以相互独立地引入你的应用。
原文: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 appcompat library

这个库添加了对Action Bar用户界面 design pattern(设计样式)的支持。

原文:This library adds support for the Action Bar user interface design pattern.


注意:这个库依赖于v4 Support Library。如果你在使用Ant或者Eclipse,确保要将v4 Support Library作为这个库classpath的一部分引入。
原文:Note: This library depends on the v4 Support Library. If you are using Ant or Eclipse, make sure you include the v4 Support Library as part of this library's classpath.

这里有一些包含在v7 appcompat库中的关键类:(此处偷个懒,省去关键类的翻译200字^_^) 
原文: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.
  • 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.
在你下载了Android Support Library以后,这个库放在/extras/android/support/v7/appcompat/ 目录下。这个库包含用户界面资源。按照 adding libraries with resources 的说明来将这个库引入你的应用项目。

原文:This library is located in the /extras/android/support/v7/appcompat/ directory after you download the Android Support Libraries. This library contains user interface resources. To include it in your application project, follow the instructions for  adding libraries with resources.

这个库的Gradle建造脚本依赖标识符如下: 
原文:The Gradle build script dependency identifier for this library is as follows:

com.android.support:appcompat-v7:18.0.+

这个依赖符号指定了发布版本为18.0.0或更高。
原文:This dependency notation specifies the release version 18.0.0 or higher.

v7 gridlayout library 

这个库添加了对 GridLayout类的支持,这个类允许你使用矩形单元的网格来排列用户界面元素。在API引用中查看android.support.v7.widget 包,以获取关于v7 gridlayout Support Library API的详细信息。

原文: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 Library以后,这个库放在/extras/android/support/v7/gridlayout/ 目录下。这个库包含用户界面资源。按照adding libraries with resources 的说明来将这个库引入你的应用项目。 

原文:This library is located in the /extras/android/support/v7/gridlayout/ directory after you download the Android Support Libraries. This library contains user interface resources. To include it in your application project, follow the instructions for adding libraries with resources.

这个库的Gradle建造脚本依赖标识符如下: 
原文:The Gradle build script dependency identifier for this library is as follows:

com.android.support:gridlayout-v7:18.0.+

这个依赖符号指定了发布版本为18.0.0或更高。
原文:This dependency notation specifies the release version 18.0.0 or higher.

v7 mediarouter library 

这个库提供了MediaRouterMediaRouteProvider和相关的支持Google Cast developer preview(谷歌投影)(译者注:谷歌投影是一种屏幕分享技术,可以将小屏幕的智能设备分享到大的屏幕上,如智能手机到电视,但是详情请看这里,或这里1,或这里2)开发者预览的媒体类。

原文:This library provides MediaRouterMediaRouteProvider, and related media classes that support the Google Cast developer preview.

总的来说,在v7 mediarouter库中的API提供了一种控制手段,它可以控制从当前设备到扩展屏幕、扬声器和其他目的设备的媒体通道和数据流的路径选择。这个库包含了一些API,这些API包含发行具有应用特性的媒体路径provider,发现和选择目的设备,检查媒体状态和其他一些功能。在API引用中查看 android.support.v7.media 包,以获取关于v7 mediarouter Support Library API的详细信息。

原文: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.

在你下载了Android Support Library以后,这个库放在/extras/android/support/v7/mediarouter/ 目录下。这个库包含用户界面资源。它是以一个从属于v7 appcompat库的库项目的方式提供给开发者使用的,所以当你在创建项目的时候,你需要在build path中同时引入这两个库。按照 adding libraries with resources 的说明以获取更多如何创建项目的信息。  如果你使用Eclipse/ADT开发,要确保同时引入android-support-v7-mediarouter.jarandroid-support-v7-appcompat.jar文件

原文:The v7 mediarouter library is located in the /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. If you are developing in Eclipse/ADT, make sure to include both the android-support-v7-mediarouter.jar and android-support-v7-appcompat.jar files.

如果你使用的是Android Studio,你只需要指定Gradle建造脚本依赖标识符com.android.support:support-v7-mediarouter:这个标识符的可用库的修正版本最低是18.0.0。例如

com.android.support:mediarouter-v7:18.0.+

原文:If you are using Android Studio, all you need to do is specify the Gradle build script dependency identifier com.android.support:support-v7-mediarouter:, where "18.0.0" is the minimum revision at which the library is available. For example:

Tip:在Support Library r18中介绍的v7 mediarouter库API受制于Support Library的后续修正变化。当前,我们推荐你只在关于Google Cast developer preview时使用这个库。

原文:Tip: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.

v8 Support Library 

这个库是为Android(API level 8)或更高版本的使用设计的。它加入了对  RenderScript 计算架构的支持。这些API包含在 android.support.v8.renderscript包中。你应该能意识到介绍包含这些API的应用程序的步骤与其他支持库的API有很大不同。查看  RenderScript开发者指南,以获取更多关于这些API的信息。

原文: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.

注意:利用Support Library使用RenderScript,这是被Android Eclipse插件和Ant build工具支持的。目前它不支持使用Android Studio或者基于Gradle构建。

原文:Note: Use of RenderScript with the support library is supported with the Android Eclipse plugin and Ant build tools. It isnot currently supported with Android Studio or Gradle-based builds.

v13 Support Library 

这个库是为Android 3.2(API level 13)或更高版本的使用设计的。它添加了对  Fragment用户界面样式(利用FragmentCompat类)和额外的fragment支持类的支持。查看  Fragment开发者指南查阅更多关于fragment的信息。在API引用中查看android.support.v13包,以获取关于v13 Support Library API的详细信息。

原文: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 Support Library以后,这个库放在 /extras/android/support/v13/  目录下。这个库不包含用户界面资源。按照 adding libraries without resources的说明来将这个库引入你的应用项目。

原文:This library is located in the /extras/android/support/v13/ directory after you download the Android Support Libraries. This library does not contain user interface resources. To include it in your application project, follow the instructions for adding libraries without resources.

这个库的Gradle建造脚本依赖标识符如下:  
原文:The Gradle build script dependency identifier for this library is as follows:

com.android.support:support-v13:18.0.+

这个依赖符号指定了发布版本为18.0.0或更高。

原文:This dependency notation specifies the release version 18.0.0 or higher.


欢迎转载,转载请注明出处:http://blog.csdn.net/crazybigfish/article/details/18552305


上一篇:【翻译】Android Support Library(一)


下一篇:【翻译】Android Support Library Setup(三)

你可能感兴趣的:(Android开发)