Deep Linking in Jetpack Compose

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone today we will talk about the blinking in Jetpack compose So currently I don't have an ID pass because I I haven't opened the Deep links so let's close this and click here and let's add the link and this is the link so adcoding.com 34 and this will open the app and we'll have the id34 so let's jump into coding the first thing we need to do is to go to build a Trader from the app module and add the navigation compose dependency and now let's go back to the main activity and create the nav controller equals remember now controller and now we need to create the nav host and press the nav controller and the start destination is home let's put arguments on separate lines and create the composable and this will be the home and now we need to define the navigation of the deep links and this is a list of nav deep link and this has an Yuri pattern and this will open the app at this specific Yuri pattern so let's create the Yuri so the base URL basically is the https a www.adcoding.com and the pattern will be Yuri and here we will have an ID so one will have one address with a slash and a four for example it will open the app at the home screen and now we want to get the back stack entry to get the argument from the deep links so ID equals backstack entry arguments get string this can be another one so we'll use the question mark and now we can create the screen so this will be a box film exercise and the content alignment will be a alignment Dot Center oops Center text and this will be the ID and otherwise it is no ID passed now we need to link the URI to the app so go to tools app links assistant open the URL mapping editor and here we will have the adcoding.com in my example and uh also we need to be careful because I uh minor is https not HTTP and I need to add an s as you can see decided the nintendent filter and some things inside so let's take them one by one and see what they are doing the action view means that it can be opened the app can be opened the category default means that the app can be opened by default by the link the category browsable means that it can be opened by a browser the scheme is the protocol that we used so with https in my case and the host is the link the rest of the link now you can check if the URL is mapped to the activities so paste the URL here and add the as a test URL and go to test device on or emulator test app links and let's add a slash here and let's save 34 and run the test as you can see everything works perfectly so if you like this video make sure to subscribe to my channel and also follow my blog to learn more about Android see you next time [Music]
Info
Channel: Daniel Atitienei
Views: 4,026
Rating: undefined out of 5
Keywords: Jetpack Compose, Kotlin, Android
Id: UICbp-QAJ3g
Channel Id: undefined
Length: 4min 15sec (255 seconds)
Published: Fri Apr 21 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.