Goal: Help Android developers with a quick and straightforward Android App Links implementation example
If you’re already familiar with the technical details behind the design, configuration, implementation, and verification of Android App Links, and you would like to get started in your own app right away, then this blog post is for you. If you are interested in learning more about those details, we have a codelab that covers them.
Here is what you will need to successfully implement an Android App Link:
Latest version of Android Studio
A deployed domain with public access
(Optional) Google Play developer account setup
Here are the steps to support an Android App Link. These steps create a basic application that displays the Intent information from an App Link.
Step 1: Create an Empty Compose Activity
1.1 In Android Studio create a new project and select “Empty Compose Activity”.
1.2 Make sure the application runs as expected before you start adding code. You should see an empty application with a “Hello Android!” message:
Step 2: Update Manifest
2.1 Include the intent filter in AndroidManifest.xml so the MainActivity will open Android App Links.
3.2 If you run this logic you will see the following text strings: One displays the Hello Android! message, the second displays the action for the intent that was called, and the third one displays the URL for the intent that was called.
Step 4: Obtain the certificate fingerprint
Before uploading the assetlinks.json file, which is part of the Digital Asset Links (DAL) protocol, you need to get the application certificate fingerprint. In this case since we haven’t released the app to the Google Play Store we can use the debug certificate fingerprint. If you want to upload the app to Google Play, you must include your releasing signing key. This page explains how to do it.
4.1 To obtain the debug/release certificate fingerprint, run the following command under the “Run Anything” menu in Android Studio: