androidx 是啥?怎么配置?

这是18年5月的文章,现在19年8月,应该没什么人问androidx 是啥了,现在补上Androidx的配置。

我的android studio版本是3.4.2

  • android studio 打开项目,选择菜单 refactor -> Migrate to AndroidX 弹出提示框,选择Migrate, 个人觉得Git管理的项目,不用勾选Backup project as Zip file,就是转化前打包zip的意思吧。
  • 选择Migrate后,检索需要修改的文件,检索完成后会在android studio底部弹出Refactoring Preview界面,可以查看会修改哪些文件。
  • 点击Cancel不会做任何修改。点击Do Refactor开始真正将项目配置成Androidx项目。

比较大或者复杂的项目,运行可能会报一些错误,慢慢修改吧!!!

参考文档

Today, we launch an early preview of the new Android extension libraries (AndroidX) which represents a new era for the Support Library. Please preview the change and give us your feedback. Since this is an early preview, we do not recommend trying this on any production projects as there are some known issues.

The Support Library started over 7+ years ago to provide backwards compatibility to framework APIs. Over the years, the library has grown to include device-specific UX, debugging, testing and other utilities. The adoption of the Support Library has been phenomenal; most Android apps use the Support Library today. We want to increase our investment in this area, and it is critical that we lay a solid foundation.

In that vein, we took a step back and chatted with many of you. The feedback has been consistent and unanimous; the organic growth of the library has become confusing. There are components and packages named "v7" when the minimal SDK level we support is 14! We want to make it clear for you to understand the division between APIs that are bundled with the platform and which are static libraries for app developers that work across different versions of Android.

With that in mind, say "Hello World" to "AndroidX". As previously noted in the Android KTX announcement, we are adding new features under this package, and updating some existing ones.

今天,我们推出了一个新的Android扩展库(ANDROIDX)的早期预览,它代表了支持库的新纪元。请预览更改并给我们您的反馈。由于这是一个早期的预览,我们不建议在任何生产项目上尝试这一点,因为存在一些已知的问题。

支持库开始于7多年前,以提供与框架API的向后兼容性。多年来,该图书馆已发展到包括特定于设备的UX、调试、测试和其他实用工具。支持库的使用是惊人的;大多数Android应用程序现在使用支持库。我们想增加我们在这方面的投资,我们打下坚实的基础是至关重要的

就这样,我们退了一步,和你们许多人聊天。反馈一致、一致,图书馆的有机发展令人困惑。当我们支持的最小SDK级别为14时,有一些组件和包名为“V7”!我们想让您明白,API是与平台捆绑在一起的,是应用程序开发人员在不同版本的Android上工作的静态库。

记住这一点,把“你好世界”说成“安卓迪克斯”。正如之前在Android KTX公告中提到的,我们在这个包下添加了新的特性,并更新了一些现有的特性。

你可能感兴趣的:(androidx 是啥?怎么配置?)