[Android] Procedure for supporting deep links

Procedure for dealing with deep links

The procedure is as follows.

** Set manifest 1 **

<intent-filter android:label="test" >
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data
                        android:host="test"
                        android:scheme="example" />
     </intent-filter>
applink_1.png

** Get data from Intent 2 **

val action: String? = intent?.action
    val data: Uri? = intent?.data
        if(data!= null) {
            val dataString = data.toString()
            if(dataString.equals("example://test")){
            intent = Intent (this, DeepActivity::class.java)
            startActivity(intent)
            } 
        }
link_2.png

** Launch the app from the a tag (deep link) 3 ** Load the html page from the browser of the terminal and tap the link to start the application

<a href="example://test"> example://test</a>

Recommended Posts

[Android] Procedure for supporting deep links
Links for creating Android apps (for beginners)
AdMob setting procedure for Android application (December 2016)
Beginner-friendly Android app publishing procedure, struggling for the first releaseāˆ
default value for android: exported
Build Spring for Android 2.0.0 environment