androidx.legacy:legacy-support-v4: 依赖有什么用
What is the use of androidx.legacy:legacy-support-v4: dependency
我正在实施 Android 房间数据库,在其中一个教程中我发现了 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-v13
com.android.support:support-v4 -> androidx.legacy:legacy-support-v4
您可以找到有关库映射的信息here
支持库 是一个静态库,您可以将其添加到您的 Android 应用程序中,以便使用无法用于不属于框架 API 的旧平台版本或实用程序 API。兼容设备 运行 API 14 或更高版本。
支持库的用途
support libraries
有一些不同的用途。 向后兼容性 class早期版本平台的es只是其中之一。
- 向后兼容较新的 APIs - 大量支持库为较新的框架 classes 和方法提供向后兼容性。例如,片段支持 class 为 Android 3.0(API 级别 11)之前的设备 运行 版本上的片段提供支持。
- 便利和帮助程序 类 - 支持库提供了许多帮助程序 classes,特别是对于用户界面开发。例如,RecyclerView class 提供了一个用户界面小部件,用于显示和管理非常长的列表,可用于 API 7 级及以上的 Android 版本。
- 调试和实用程序 - 除了您合并到应用程序中的代码之外,还有许多功能提供实用程序,包括用于改进方法输入代码 lint 检查的支持注释库和 Multidex 支持使用超过 65,536 种方法配置和分发应用程序。
查看官方文档support-library
来自 docs
的重要提示
Note: With the release of Android 9.0 (API level 28) there is a new
version of the support library called AndroidX which is part of
Jetpack. The AndroidX library contains the existing support library
and also includes the latest Jetpack components.
You can continue to use the support library. Historical artifacts
(those versioned 27 and earlier, and packaged as android.support.*)
will remain available on Google Maven. However, all new library
development will occur in the AndroidX library.
We recommend using the AndroidX libraries in all new projects. You
should also consider migrating existing projects to AndroidX as well.
我正在实施 Android 房间数据库,在其中一个教程中我发现了 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-v13 com.android.support:support-v4 -> androidx.legacy:legacy-support-v4
您可以找到有关库映射的信息here
支持库 是一个静态库,您可以将其添加到您的 Android 应用程序中,以便使用无法用于不属于框架 API 的旧平台版本或实用程序 API。兼容设备 运行 API 14 或更高版本。
支持库的用途
support libraries
有一些不同的用途。 向后兼容性 class早期版本平台的es只是其中之一。
- 向后兼容较新的 APIs - 大量支持库为较新的框架 classes 和方法提供向后兼容性。例如,片段支持 class 为 Android 3.0(API 级别 11)之前的设备 运行 版本上的片段提供支持。
- 便利和帮助程序 类 - 支持库提供了许多帮助程序 classes,特别是对于用户界面开发。例如,RecyclerView class 提供了一个用户界面小部件,用于显示和管理非常长的列表,可用于 API 7 级及以上的 Android 版本。
- 调试和实用程序 - 除了您合并到应用程序中的代码之外,还有许多功能提供实用程序,包括用于改进方法输入代码 lint 检查的支持注释库和 Multidex 支持使用超过 65,536 种方法配置和分发应用程序。
查看官方文档support-library
来自 docs
的重要提示Note: With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX which is part of Jetpack. The AndroidX library contains the existing support library and also includes the latest Jetpack components.
You can continue to use the support library. Historical artifacts (those versioned 27 and earlier, and packaged as android.support.*) will remain available on Google Maven. However, all new library development will occur in the AndroidX library.
We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well.