1

我想知道在我们开始下载之前是否可以知道动态功能模块的大小。我在网络上的任何地方都没有找到答案=/。

4

1 回答 1

0

NO.

But there is a hack for it.

  1. If your dynamic module size < 10MB
  2. call SplitInstallRequest builder in the background on App launch.
  3. implement SplitInstallStateUpdatedListener onStateUpdate() call back.
  4. in SplitInstallSessionStatus.DOWNLOADING state you get size of your module.
  5. install your module by SplitCompat.install(context) when user want to use it.

Note: This approach violate the rule of dynamic delivery But you can consider it as per your requirement or need.

于 2020-06-08T08:17:00.887 回答