我是否需要使用Android的支持库 [英] Do I need to use Android support library

查看:139
本文介绍了我是否需要使用Android的支持库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新: 现在,与Android体验个月后,我的理解是支持库回来,从更高层次的API新功能的端口。例如,支持LIB V4实现了一些使用API​​和其中的新功能。= 4只

感谢您的帮助。

解决方案
  

它包含什么是什么呢?正在使用API​​级别4仿效从较新的层次的API?

是的,没有。它包含了更新的API两个回油口的版本(如片段),以及其他功能不可用之外的支持库。

从href="http://developer.android.com/tool​​s/support-library/index.html">支持库文档(重点煤矿)的

  

Android的支持库包是一套提供了Android框架API的和功能,这些功能只能通过库API向后兼容的版本code库。每个支持库是向后兼容到一个特定的Andr​​oid API级别。这样的设计意味着你的应用程序可以使用图书馆的功能,并且仍然有运行Android 1.6(API等级4)及以上设备兼容。

有多个版本的支持库,每一个都支持不同的最低API级别:

  • V4支持回到1.6(API等级4)
  • 在V7支持回到2.1(API 7级)
  • 在V8支持回2.2(API级别8)
  

我的最小API级别为15。我是否需要使用(或更在乎)支持V4?

也许吧。检查href="http://developer.android.com/tool​​s/support-library/features.html">支持库特征文档的 DrawerLayout 不可支持库之外的。

Updated: Now after months of experience with Android, I understand that support libraries are back ports of new features from higher API levels. For example, support lib v4 implements some of the new features using API <= 4 only.

Thanks for the help.

解决方案

What does it contain exactly? APIs from newer levels that are emulated using API level 4?

Yes and no. It contains both back-ported versions of newer APIs (such as Fragment), as well as other features that are not available outside of the support library.

From the support library documentation (emphasis mine):

The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level. This design means that your applications can use the libraries' features and still be compatible with devices running Android 1.6 (API level 4) and up.

There are multiple versions of the support library, each supporting a different minimum API level:

  • v4 supports back to 1.6 (API level 4)
  • v7 supports back to 2.1 (API level 7)
  • v8 supports back to 2.2 (API level 8)

My min API level is 15. Do I need to use (or even care about) support v4?

Maybe. Check the Support Library Features documentation. Do you need any of those things? Some, such as DrawerLayout are not available outside the support library.

这篇关于我是否需要使用Android的支持库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆