Ready to begin converting your installed app to an instant app? This article takes you through the steps you need to complete in order to convert your existing APK to an instant app.
Step 1: Develop a use case for your instant app
Focus on a core user experience that completes a specific action and optimizes a key business metric besides app installs. Then review the user experience guidelines for Android Instant Apps.
Step 2: Prepare your app for conversion
Make sure that you have prepared your app for conversion to an instant app.
Step 3: Implement Android App Links
The Android App Links feature was introduced in Android 6.0 and lets users tap on a web link to open an app if it has already been installed and verified.
Instant apps leverage the same app links feature to map HTTPS URLs to entry-point activities in instant apps. App links are required in instant apps because they are the only way a user can launch an instant app (instant apps are not installed).
You must implement app links in your regular app before converting your project to support instant apps. For more information about how to implement and test app links, see Handling App Links. Android Studio includes a tool for implementing app links. For more information, see Add Android App Links.
For instant apps, you must set the
true in all
This attribute tells Google to verify your app link with a Digital
Assets Links (DAL)
file that is hosted on your website and prevents apps
from linking to domains that they do not own.
The apps links that your regular app supports must be a superset of the app links that your instant app supports. For example, if the instant app declares that it handles the URL 'http://example.com/hello', then the APK needs to handle the same URL. However, the instant app does not need to handle all of the same URLs as the APK. If the APK declares that it handles the URL 'http://example.com/bye', the instant app does not need to handle it too.
Verifying app links
Once you have implemented app links in your app, you can verify that the app links behave as intended using a couple of different tools.
The Statement List Generator and Tester allows you to test an existing statement file to determine that the app links are correct.
You can also review the steps provided in Test App Links. The article shows you how to use the Digital Asset Links API to confirm that the Digital Asset Links JSON file is property hosted and defined.
Step 4: Set up your development environment
Install the Instant Apps SDK and then set up your development environment and test devices.
Step 5: Build a simple instant app
Follow the guide to create a first instant app.
You can also learn how to refactor a simple Android Studio project to become an instant app by completing the Instant Apps Codelab.
Step 6: Plan the structure of your instant app
Before restructuring your own app as an instant app, you must decide how to structure your app and then plan your restructuring efforts. This process can differ for each app, depending on the complexity and design of your app.
For more information about how to restructure your Android Studio project to build an instant app, see Project structure.
Step 7: Build and run your instant app
Step 8: Test and distribute your instant app
When you're ready to test and distribute your instant app, you can configure releases through the Google Play Console. For more information, see Distribute your instant app.