https://kotlinlang.org logo
#android
Title
# android
n

Nikola Milovic

07/07/2020, 4:45 PM
What is a deeplink URI for another module? I am trying to deeplink 2 fragments together from different modules and connect them via deeplinks (as I cannot find any other way) and Idk how to structure the URI's. (here is the more detailed question on stackoverflow, ive went through 4,5 projects now and a couple of articles but they're horrible for getting started) This is the example from the article
Copy code
<deepLink app:uri="myApp://fragmentD"/>
What does myApp represent, and how is it structured? By directories, or modules?
j

Javier

07/07/2020, 8:02 PM
You can have a navigation module which is implemented by the feature modules
i

Ian Lake

07/08/2020, 12:35 AM
Does it matter what your URI is if it is only internal?
n

Nikola Milovic

07/08/2020, 3:04 PM
@Ian Lake But how is the URI formated? @Javier Tried that but still cannot access the ID of the other fragment in the other module
j

Javier

07/08/2020, 3:05 PM
you can because the feature module implements the navigation module
the fragment in the navigation module graph is shown in red color because the nav module doesnt implement the feature module, but it works. You can see a similar approach if you see how navigation component works with dynamic feature modules
i

Ian Lake

07/08/2020, 3:45 PM
Again, does it matter how the URI is formatted? You can use whatever URI you want, since it only needs to be consistent within your app
URIs are indeed the correct way to navigate between modules that don't have a dependency on one another and the only way to navigate to a destination within another graph (you don't have access to destinations within another graph)
n

Nikola Milovic

07/08/2020, 4:21 PM
@Ian Lake Then I'll use that, but how do i structure my URIs? There is nothing in the docs related to that. I get the idea behind it, but how do I structure my URI to point to my Module A for example? Sorry but I cannot find this info anywhere
i

Ian Lake

07/08/2020, 4:38 PM
That's because it doesn't matter. As long as you
navigate(uri
) with the same Uri as your
<deepLink>
, that's enough
n

Nikola Milovic

07/08/2020, 5:16 PM
@Ian Lake Thank you! After some thinkering got it working
20 Views