In this tutorial, we’ll be discussing what are Instant Apps in Android and how to implement them in our android application.
在本教程中,我们将讨论什么是Android中的即时应用程序以及如何在我们的android应用程序中实现它们。
Android Instant Apps (Android Instant Apps)
It often happens on the web that when we open an URL link, it asks us to download the application. This can hamper the User Experience.
在网络上经常发生的情况是,当我们打开URL链接时,它要求我们下载该应用程序。 这可能会妨碍用户体验。
Hence google has come up with Instant Apps which are a mini version of the full application and can be launched from url without downloading the application entirely.
因此,谷歌提出了即时应用程序,这是完整应用程序的迷你版本,可以从url启动而无需完全下载该应用程序。
In Google Playstore, applications with instant apps feature would have a TRY NOW button along with the install button.
在Google Playstore中,具有即时应用程序功能的应用程序将具有“立即尝试”按钮和安装按钮。
Instant Apps are currently supported for devices running Android 5.0 and above.
目前,运行Android 5.0及更高版本的设备支持Instant Apps。
Instant Apps require the developers to modularise their project such that it would contain different screens/resources in different modules.
Instant Apps要求开发人员对他们的项目进行模块化,以便在不同的模块中包含不同的屏幕/资源。
An instant app project largely consists of the following modules:
即时应用项目主要由以下模块组成:
- app module 应用模块
- instantapp module Instantapp模块
- base feature module 基本功能模块
应用模块 (app module)
app module contains everything that must not be there in the instant app. Having said that, the applicationId would be defined in the base feature module only.
应用程序模块包含即时应用程序中不能存在的所有内容。 话虽这么说, applicationId只能在基本功能模块中定义。