Google Play Instant Apps are Play Store apps you can open before requiring installation. If you like the app you can download and purchase it if necessary from the Play Store.
To create an instant app you require Android Studio 3.3 or higher and Google Play Instant Development SDK installed.
Now create a new project and in the process, you will see a checkbox to enable instant apps. Please check the image below.
Now you need to change your application module into a feature module so that it can be available to the instant app and normal app as well. At the end there should be three modules:
Every app that supports Google Play Instant must have one feature module marked as the base feature module to have the features to be used in instant app. It can be enabled in build.gradle file.
Implement the feature module containing the app code in the instant app module. Example below:
implementation project(':base') //base is feature module
Final step is to create a App Link as users don’t install your app when using Google Play Instant, so to open your app, users will usually click on a link. For Google Play Instant, URLs are the entry point into an app and they are associated with Activities. These URLs must be verified App Links. Example of App Link can be viewed in the below image.
Now you may select the instant module and run the instant app on the device.
Few things to remember:
INSTANT_APP_FOREGROUND_SERVICE– Only in Android 8.0 (API level 26) and higher.
READ_PHONE_NUMBERS– Only in Android 8.0 (API level 26) and higher.
Be the first to comment.