Deep-Linking in Jetpack Compose — Android

<p>In this article, we&rsquo;ll learn how to easily implement deep-linking in Jetpack Compose.</p> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:630/1*4vKhKWZiSav6q34qhfXVYQ.jpeg" style="height:394px; width:700px" /></p> <h2>What is Deep-Linking?</h2> <p><strong>Deep-linking</strong>&nbsp;allows users to navigate to specific content within an app directly from an external source, such as a website or another app.</p> <h2>Dependency</h2> <p>Go ahead to&nbsp;<code>:app/build.gradle.kts</code>&nbsp;and add the navigation dependency.</p> <pre> dependencies { implementation(&quot;androidx.navigation:navigation-compose:2.5.3&quot;) }</pre> <p>Now let&rsquo;s go back to the&nbsp;<code>MainActivity.kt</code>&nbsp;and setup the navigation.</p> <h2>Step 1</h2> <p>Create the&nbsp;<code>navController</code>.</p> <pre> val navController = rememberNavController()</pre> <h2>Step 2</h2> <p>Create the&nbsp;<code>NavHost</code>&nbsp;and the screen.</p> <pre> NavHost( navController = navController, startDestination = &quot;home&quot; ) { composable( route = &quot;home&quot; ) { // ... } }</pre> <p><a href="https://medium.com/@daniel.atitienei/deep-linking-in-jetpack-compose-android-f9a70d432896">Read More</a></p>