androidx.legacy:legacy-support-v4:依赖关系有什么用 [英] What is the use of androidx.legacy:legacy-support-v4: dependency

查看:2690
本文介绍了androidx.legacy:legacy-support-v4:依赖关系有什么用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实现Android Room Database,并且在本教程之一中,我发现了 androidx.legacy:legacy-support-v4:1.0.0 依赖项的用法.谁能告诉我这种依赖性的使用.

解决方案

androidx.legacy:legacy-support-v4 Androidx 工件 com.android.support:support-v4

com.android.support:support-v13-> androidx.legacy:legacy-support-v13com.android.support:support-v4-> androidx.legacy:legacy-support-v4

您可以在此处

支持库是一个静态库,您可以将其添加到Android应用程序中,以使用旧平台版本不可用的API或不属于其中的实用程序API.框架API.在运行API 14或更高版本的设备上兼容.

用于支持库

支持库有一些不同的用途.较早版本的平台的向后兼容类只是其中之一.

  • 较新的API的向后兼容性-大量的支持库为较新的框架类和方法提供了向后兼容性.例如,片段支持类为运行Android 3.0之前版本(API级别11)的设备上的片段提供支持.
  • 便利和帮助程序类-支持库提供了许多帮助程序类,尤其是用于用户界面开发的.例如,RecyclerView类提供了一个用于显示和管理很长列表的用户界面小部件,可在API级别7以上的Android版本上使用.
  • 调试和实用程序-除了您集成到应用程序中的代码外,还有许多功能可提供实用程序,包括支持注释库,用于改进对方法输入的代码检查,以及对配置的Multidex支持并使用65,536种以上的方法分发应用.

在此处查看官方文档支持库

I was implementing Android Room Database and in one of the tutorial I found the usage of androidx.legacy:legacy-support-v4:1.0.0 dependency. Can any one tell me use of this dependency.

解决方案

androidx.legacy:legacy-support-v4 is Androidx artifacts of com.android.support:support-v4

com.android.support:support-v13 -> androidx.legacy:legacy-support-v13 com.android.support:support-v4 -> androidx.legacy:legacy-support-v4

You can find info about the library mapping here

The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later.

Uses for the Support Libraries

There are a few distinct uses for the support libraries. Backward compatibility classes for earlier versions of the platform is just one of them.

  • Backward Compatibility for newer APIs - A large amount of the support libraries provide backward compatibility for newer framework classes and methods. For example, the Fragment support class provides support for fragments on devices running versions earlier than Android 3.0 (API level 11).
  • Convenience and Helper Classes - The support libraries provides a number of helper classes, particularly for user interface development. For example, the RecyclerView class provides a user interface widget for displaying and managing very long lists, useable on versions of Android from API level 7 and up.
  • Debugging and Utilities - There are a number of features that provide utility beyond code you incorporate into your app, including the support-annotations library for improved code lint checks on method inputs and Multidex support for configuring and distributing apps with over 65,536 methods.

See official documents here support-library

这篇关于androidx.legacy:legacy-support-v4:依赖关系有什么用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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