python分析之androidX包差异

python分析之androidX包差异,第1张

概述x的最低实验条件AndroidStudio3.2.0+gradle:gradle-4.6以上本次实验条件:AndroidStudio3.3(AS3.3强制要求最低gradle版本为gradle-4.10-all)gradle:gradle-4.10-all使用AndroidX如果要在新项目中使用AndroidX,则需要将compileSDK设置为Android9.0(API级别28)或更高版本,并在gradl

x的最低实验条件

AndroIDStudio 3.2.0+
gradle:gradle-4.6以上
本次实验条件:
AndroIDStudio 3.3 (AS3.3强制要求最低gradle版本为gradle-4.10-all)
gradle:gradle-4.10-all

使用AndroIDX

如果要在新项目中使用AndroIDX,则需要将compile SDK设置为AndroID 9.0(API级别28)或更高版本,并在gradle.properties文件中设置以下两个AndroID Gradle插件标志。

androID.useandroidX:设置true为时,AndroID插件使用相应的AndroIDX库而不是支持库。如果未指定,则默认情况下为false标志 。androID.enableJetifIEr:设置true为时,AndroID插件会自动迁移现有的第三方库,通过重写其二进制文件来使用AndroIDX。如果未指定,则默认情况下为false标志。

AndroIDX概述

AndroIDX是AndroID团队用于在Jetpack中开发,测试,打包,发布和发布库的开源项目 。
AndroIDX是对原始AndroID 支持库的重大改进 。与支持库一样,AndroIDX与AndroID *** 作系统分开提供,并提供跨AndroID版本的向后兼容性。AndroIDX通过提供功能奇偶校验和新库完全取代了支持库。此外,AndroIDX还包括以下功能:

AndroIDX中的所有软件包都以字符串开头,位于一致的命名空间androIDx中。支持库包已映射到相应的androIDx.*包中。有关所有旧类和构建工件的完整映射到新构件,请参阅“ 包重构”页面。与支持库不同,AndroIDX软件包是单独维护和更新的。这些androIDx包使用严格的语义版本控制, 从版本1.0.0开始。您可以单独更新项目中的AndroIDX库。所有新的支持库开发都将在AndroIDX库中进行。这包括维护原始支持库工件和引入新的Jetpack组件。

其实就是对安卓过往v7,v4,design等系列包的一个整合,不用我们多次添加与核对版本号,大大方便了我们的开发,真的是早就该这样做了。

开始体验x

新建工程有个勾,勾上

创建完成后就会发现gradle.propertIEs多了两行

 


这两行的作用主要是自动迁移任何尚未迁移到AndroIDX命名空间的Maven依赖项目至AndroIDX命名空间,如果是老项目现在想把整个工程其它包替换为androIDx包,在手动添加上面这两行后直接使用AS Refactor->Migrate to AndroIDX即可。

 

这个时候由于我本地还没有androix这个库,新建工程时的这两个在线引用
implementation 'androIDx.appcompat:appcompat:1.0.0-beta01'
implementation 'androIDx.constraintlayout:constraintlayout:1.1.2'

也没有引起AS给我自动下载下来androIDx整个包,感觉很奇怪,就去官网随便找了一个对应的一个依赖,在线一填,导致它x包所有东西都下载下来了,一切回归正常,在xml和java文件写了好几个以前分布在不同的包的类,没发现什么问题,至此体验结束。
功臣包名:implementation 'com.Google.androID.material:material:1.0.0-rc01'

旧版本包与AndroIDX对照表

旧包AndroIDX
androID.arch.core:commonandroIDx.arch.core:core-common:2.0.0-rc01
androID.arch.core:coreandroIDx.arch.core:core:2.0.0-rc01
androID.arch.core:core-testingandroIDx.arch.core:core-testing:2.0.0-rc01
androID.arch.core:runtimeandroIDx.arch.core:core-runtime:2.0.0-rc01
androID.arch.lifecycle:commonandroIDx.lifecycle:lifecycle-common:2.0.0-rc01
androID.arch.lifecycle:common-java8androIDx.lifecycle:lifecycle-common-java8:2.0.0-rc01
androID.arch.lifecycle:compilerandroIDx.lifecycle:lifecycle-compiler:2.0.0-rc01
androID.arch.lifecycle:extensionsandroIDx.lifecycle:lifecycle-extensions:2.0.0-rc01
androID.arch.lifecycle:livedataandroIDx.lifecycle:lifecycle-livedata:2.0.0-rc01
androID.arch.lifecycle:livedata-coreandroIDx.lifecycle:lifecycle-livedata-core:2.0.0-rc01
androID.arch.lifecycle:reactivestreamsandroIDx.lifecycle:lifecycle-reactivestreams:2.0.0-rc01
androID.arch.lifecycle:runtimeandroIDx.lifecycle:lifecycle-runtime:2.0.0-rc01
androID.arch.lifecycle:viewmodelandroIDx.lifecycle:lifecycle-viewmodel:2.0.0-rc01
androID.arch.paging:commonandroIDx.paging:paging-common:2.0.0-rc01
androID.arch.paging:runtimeandroIDx.paging:paging-runtime:2.0.0-rc01
androID.arch.paging:rxjava2androIDx.paging:paging-rxjava2:2.0.0-rc01
androID.arch.persistence.room:commonandroIDx.room:room-common:2.0.0-rc01
androID.arch.persistence.room:compilerandroIDx.room:room-compiler:2.0.0-rc01
androID.arch.persistence.room:guavaandroIDx.room:room-guava:2.0.0-rc01
androID.arch.persistence.room:migrationandroIDx.room:room-migration:2.0.0-rc01
androID.arch.persistence.room:runtimeandroIDx.room:room-runtime:2.0.0-rc01
androID.arch.persistence.room:rxjava2androIDx.room:room-rxjava2:2.0.0-rc01
androID.arch.persistence.room:testingandroIDx.room:room-testing:2.0.0-rc01
androID.arch.persistence:dbandroIDx.sqlite:sqlite:2.0.0-rc01
androID.arch.persistence:db-frameworkandroIDx.sqlite:sqlite-framework:2.0.0-rc01
com.androID.support.constraint:constraint-layoutandroIDx.constraintlayout:constraintlayout:1.1.2
com.androID.support.constraint:constraint-layout-solverandroIDx.constraintlayout:constraintlayout-solver:1.1.2
com.androID.support.test.espresso.IDling:IDling-concurrentandroIDx.test.espresso.IDling:IDling-concurrent:3.1.0
com.androID.support.test.espresso.IDling:IDling-netandroIDx.test.espresso.IDling:IDling-net:3.1.0
com.androID.support.test.espresso:espresso-accessibilityandroIDx.test.espresso:espresso-accessibility:3.1.0
com.androID.support.test.espresso:espresso-contribandroIDx.test.espresso:espresso-contrib:3.1.0
com.androID.support.test.espresso:espresso-coreandroIDx.test.espresso:espresso-core:3.1.0
com.androID.support.test.espresso:espresso-IDling-resourceandroIDx.test.espresso:espresso-IDling-resource:3.1.0
com.androID.support.test.espresso:espresso-intentsandroIDx.test.espresso:espresso-intents:3.1.0
com.androID.support.test.espresso:espresso-remoteandroIDx.test.espresso:espresso-remote:3.1.0
com.androID.support.test.espresso:espresso-webandroIDx.test.espresso:espresso-web:3.1.0
com.androID.support.test.janktesthelper:janktesthelperandroIDx.test.jank:janktesthelper:1.0.1
com.androID.support.test.services:test-servicesandroIDx.test:test-services:1.1.0
com.androID.support.test.uiautomator:uiautomatorandroIDx.test.uiautomator:uiautomator:2.2.0
com.androID.support.test:monitorandroIDx.test:monitor:1.1.0
com.androID.support.test:orchestratorandroIDx.test:orchestrator:1.1.0
com.androID.support.test:rulesandroIDx.test:rules:1.1.0
com.androID.support.test:runnerandroIDx.test:runner:1.1.0
com.androID.support:animated-vector-drawableandroIDx.vectordrawable:vectordrawable-animated:1.0.0
com.androID.support:appcompat-v7androIDx.appcompat:appcompat:1.2.0
com.androID.support:asynclayoutinflaterandroIDx.asynclayoutinflater:asynclayoutinflater:1.0.0
com.androID.support:carandroIDx.car:car:1.0.0-Alpha5
com.androID.support:cardvIEw-v7androIDx.cardvIEw:cardvIEw:1.0.0
com.androID.support:collectionsandroIDx.collection:collection:1.0.0
com.androID.support:coordinatorlayoutandroIDx.coordinatorlayout:coordinatorlayout:1.0.0
com.androID.support:cursoradapterandroIDx.cursoradapter:cursoradapter:1.0.0
com.androID.support:customtabsandroIDx.browser:browser:1.0.0
com.androID.support:customvIEwandroIDx.customvIEw:customvIEw:1.0.0
com.androID.support:designcom.Google.androID.material:material:1.0.0-rc01
com.androID.support:documentfileandroIDx.documentfile:documentfile:1.0.0
com.androID.support:drawerlayoutandroIDx.drawerlayout:drawerlayout:1.0.0
com.androID.support:exifinterfaceandroIDx.exifinterface:exifinterface:1.0.0
com.androID.support:grIDlayout-v7androIDx.grIDlayout:grIDlayout:1.0.0
com.androID.support:heifwriterandroIDx.heifwriter:heifwriter:1.0.0
com.androID.support:interpolatorandroIDx.interpolator:interpolator:1.0.0
com.androID.support:leanback-v17androIDx.leanback:leanback:1.0.0
com.androID.support:loaderandroIDx.loader:loader:1.0.0
com.androID.support:localbroadcastmanagerandroIDx.localbroadcastmanager:localbroadcastmanager:1.0.0
com.androID.support:media2androIDx.media2:media2:1.0.0-Alpha03
com.androID.support:media2-exoplayerandroIDx.media2:media2-exoplayer:1.0.0-Alpha01
com.androID.support:mediarouter-v7androIDx.mediarouter:mediarouter:1.0.0
com.androID.support:multIDexandroIDx.multIDex:multIDex:2.0.0
com.androID.support:multIDex-instrumentationandroIDx.multIDex:multIDex-instrumentation:2.0.0
com.androID.support:palette-v7androIDx.palette:palette:1.0.0
com.androID.support:percentandroIDx.percentlayout:percentlayout:1.0.0
com.androID.support:preference-leanback-v17androIDx.leanback:leanback-preference:1.0.0
com.androID.support:preference-v14androIDx.legacy:legacy-preference-v14:1.0.0
com.androID.support:preference-v7androIDx.preference:preference:1.0.0
com.androID.support:printandroIDx.print:print:1.0.0
com.androID.support:recommendationandroIDx.recommendation:recommendation:1.0.0
com.androID.support:recyclervIEw-selectionandroIDx.recyclervIEw:recyclervIEw-selection:1.0.0
com.androID.support:recyclervIEw-v7androIDx.recyclervIEw:recyclervIEw:1.0.0
com.androID.support:slices-buildersandroIDx.slice:slice-builders:1.0.0
com.androID.support:slices-coreandroIDx.slice:slice-core:1.0.0
com.androID.support:slices-vIEwandroIDx.slice:slice-vIEw:1.0.0
com.androID.support:slIDingpanelayoutandroIDx.slIDingpanelayout:slIDingpanelayout:1.0.0
com.androID.support:support-annotationsandroIDx.annotation:annotation:1.0.0
com.androID.support:support-compatandroIDx.core:core:1.0.0
com.androID.support:support-contentandroIDx.contentpager:contentpager:1.0.0
com.androID.support:support-core-uiandroIDx.legacy:legacy-support-core-ui:1.0.0
com.androID.support:support-core-utilsandroIDx.legacy:legacy-support-core-utils:1.0.0
com.androID.support:support-dynamic-animationandroIDx.dynamicanimation:dynamicanimation:1.0.0
com.androID.support:support-emojiandroIDx.emoji:emoji:1.0.0
com.androID.support:support-emoji-appcompatandroIDx.emoji:emoji-appcompat:1.0.0
com.androID.support:support-emoji-bundledandroIDx.emoji:emoji-bundled:1.0.0
com.androID.support:support-fragmentandroIDx.fragment:fragment:1.0.0
com.androID.support:support-media-compatandroIDx.media:media:1.0.0
com.androID.support:support-tv-provIDerandroIDx.tvprovIDer:tvprovIDer:1.0.0
com.androID.support:support-v13androIDx.legacy:legacy-support-v13:1.0.0
com.androID.support:support-v4androIDx.legacy:legacy-support-v4:1.0.0
com.androID.support:support-vector-drawableandroIDx.vectordrawable:vectordrawable:1.0.0
com.androID.support:swiperefreshlayoutandroIDx.swiperefreshlayout:swiperefreshlayout:1.0.0
com.androID.support:textclassifIErandroIDx.textclassifIEr:textclassifIEr:1.0.0
com.androID.support:TransitionandroIDx.Transition:Transition:1.0.0
com.androID.support:versionedparcelableandroIDx.versionedparcelable:versionedparcelable:1.0.0
com.androID.support:vIEwpagerandroIDx.vIEwpager:vIEwpager:1.0.0
com.androID.support:wearandroIDx.wear:wear:1.0.0
com.androID.support:webkitandroIDx.webkit:webkit:1.0.0

参考文章:
【google官方】androix包
【google官方】现有项目迁移教程

总结

以上是内存溢出为你收集整理的python分析之androidX包差异全部内容,希望文章能够帮你解决python分析之androidX包差异所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1041192.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存