我们可以为现有应用程序创建即时 android 应用程序吗?

Can we create instant android application for an existing application?

我在 google Playstore 中有一个现有的 Android 应用程序。该应用程序的大小约为 38MB。经过多次优化并使用远程资源和使用 Web 图像格式后,APK 已降至 25MB 左右。

为了创建一个 Instant Android 应用程序,我们需要将我们的应用程序分解为多个模块,并将通用内容放入基本模块。如果我在此基础上分离我的应用程序,我认为我的每个模块将小于 4MB。但是,完整的捆绑包本身将超过 20MB。

据我所读the instant app size must not exceed 4MB。在我的例子中,即时应用程序小于 4MB,但整个包很大。

我的问题是,如果模块大小和免安装应用小于 4 MB,但整个 Bundle 大小为 20MB 以上,我们能否让免安装应用在 Play 商店上运行?

根据文档

For an app bundle to be instant-enabled, the combined download size of the code and resources within all instant-enabled modules must be at most 10 MB.

但是

When you use Google Play's internal test track, the Play Console doesn't apply the size limits discussed in the Google Play Instant overview. Therefore, you can test and internally showcase an instant experience, even if it's larger than 10 MB.

https://developer.android.com/topic/google-play-instant/overview and https://developer.android.com/topic/google-play-instant/getting-started/instant-enabled-app-bundle

https://developer.android.com/topic/google-play-instant/guides/reduce-module-size?tenant=irina 可以帮助您减小应用程序的大小。

结论: 如果所有模块和资源的总大小为 20MB,那么看起来唯一的解决方案就是减小大小。