当前位置:网站首页>Android App Bundle探索,客户端开发面试题目
Android App Bundle探索,客户端开发面试题目
2022-06-23 22:20:00 【普通网友】
Android App Bundle是Google最新推出的Apk动态打包,动态组件化的技术,通过一个.aab结尾的bundle文件组装一个apk来为你的设备安装。这是一篇科普的文章,后续会对源码进行剖析。 [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-8EU4n8MZ-1637979015924)(https://user-gold-cdn.xitu.io/2018/6/3/163c3bfe69e8f879?imageView2/0/w/1280/h/960/ignore-error/1)]
通俗理解就是,Appbudle就是把Apk拆分成了多个积木,之前我们是把一个大而全的apk装到你手机里面,但是你其实用不到这么多东西,比如,你xxhdpi的手机屏幕是不需要xhdpi的图片资源的,但是在这之前都是已经打包进去了,会很浪费。
AppBundle将这些特性在多个维度进行拆分,在资源维度,ABI维度和Language维度进行了拆分,你只要按需组装你的Apk然后安装即可,不用安装其他的东西,这堆包大小和方法数还有启动等等有一个十分好的收益。
另外一个重要的创举是支持组件的动态下发,后面会讲到,你可以将一些独立的模块在运行时安装,而不是一次性放到apk里面。这是组件化的一次伟大的创举。
App Bundle 中的组件
- Base Apk: base为基础模块,包括你业务逻辑中的代码,dex等基础,为主工程的apk
- Configuration Split Apk: 构造apk,区分的维度是Multiple Apks的划分。用来拼装Dynamic Feature Apks和Base Apk的配置。
- Dynamic Feature Apk: 动态特性Apk,这是组件化的一个好的新方案,通过动态下发模块来做到功能的动态更新
bundletool工具
当你选择将App打包成.aab(Android App Bundle)的后缀文件之后,如何测试你的Apk是否可用,bundletool工具正是用来处理这个aab文件的。
Github:https://github.com/google/bundletool
使用方法:https://developer.android.com/guide/app-bundle/test
bundletool是google推出的开源工具,使用方法十分简单,使用几行命令就可以获取出针对相应设备的Apk,也可以一键进行安装,签名等操作。Google Play也是使用bundletool来进行aab解包分发给不同的设备的。
兼容性问题
Api < 21的手机无法进行模块化,Google Play会对其进行Multiple Apks操作来进行下发操作。
当你创建一个Dynamic Module的时候,下图
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-PaBpsLyp-1637979015938)(https://user-gold-cdn.xitu.io/2018/6/3/163c3bfe05490c11?imageView2/0/w/1280/h/960/ignore-error/1)]
上面有两个选项,一个文本框
- Enable on-demand: 是否启用按需下载,如果不启用,会直接打进Apk
- Fusing:熔断操作,是否安装到不支持按需下载的设备中
- Module title: 模块标题
对于动态组件的一些使用场景[](about:blank#%E5%AF%B9%E4%BA%8E%E5%8A%A8%E6%80%81%E7%BB%84%E4%BB%B6%E7%
《Android学习笔记总结+最新移动架构视频+大厂安卓面试真题+项目实战源码讲义》
【docs.qq.com/doc/DSkNLaERkbnFoS0ZF】 完整内容开源分享
9A%84%E4%B8%80%E4%BA%9B%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF)
语言包的动态下发
E7%9A%84%E5%8A%A8%E6%80%81%E4%B8%8B%E5%8F%91)
边栏推荐
- Cross domain issues of the new version of Google browser
- Leetcode - linked list written test questions
- EasyCVR程序以服务启动异常,进程启动却正常,是什么原因?
- Server2022 activation
- High imitation Betta app
- 物联网卡设备接入EasyCVR,如何查看拉流IP以及拉流时间?
- Docker Deployment redis
- 依赖倒置原则
- This high imitation millet mall project is amazing
- Generative countermeasure networks (Gans) and variants
猜你喜欢

Windows10 security mode entry cycle blue screen repair
![Total number of combinations ii[each element can only be solved by + once]](/img/06/a40e28a1882a4278883202bc9c72d3.png)
Total number of combinations ii[each element can only be solved by + once]

抖音实战~密码找回

NLP工程师是干什么的?工作内容是什么?

Generate all possible binary search trees

Notepad++ practical function sharing (common methods for replacing the end and beginning of regular lines, text comparison function, etc.)

Revit API:明细表 ViewSchedule

【图像检测显著图】基于matlab失真提示鱼眼图显著图计算【含Matlab源码 1903期】

Smart doc + Torna compatible version

Classical Chinese can be programmed???
随机推荐
. Net
Classical Chinese can be programmed???
[bug] the element in C iqueryable cannot change its value
【面试经验包】面试被吊打经验总结(一)
return、const、volatile关键字
【图像检测显著图】基于matlab失真提示鱼眼图显著图计算【含Matlab源码 1903期】
量化投资模型——高频交易做市模型相关(Avellaneda & Stoikov’s)研究解读&代码资源
B2B transaction management system of electronic components industry: improve the data-based driving ability and promote the growth of enterprise sales performance
What is the difference between overload and override?
Multi store drug inventory system source code large chain drugstore management system source code
PMP Exam related calculation formula summary! Must see before examination
Keywords such as extern and struct
Nice input edit box
数字物业管理成趋势,传统物业公司如何通过转型实现数字化蝶变?
DO280OpenShift访问控制--管理项目和账户
医疗是什么?AI医疗概念解析AI
Generate all possible binary search trees
Use of reverse tools IDA and GDB
.NET 中的 Worker Service 介绍
The easycvr program started abnormally as a service, but the process started normally. What is the reason?