Deeplink
in Manifest.xml’s activity tag
add following config for link wsapp://edu.ws2022.a2/app/worldskills
<intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:host="edu.ws2022.a2" android:path="/app/worldskills" android:scheme="wsapp" /></intent-filter>val uri = intent?.data
// Full URI stringval fullUri = uri?.toString() // "myapp://detail/123?name=John"
// Scheme & hostval scheme = uri?.scheme // "myapp"val host = uri?.host // "detail"
// Path segments — splits path by "/"val segments = uri?.pathSegments // ["detail", "123"]val itemId = uri?.pathSegments?.getOrNull(1) // "123"
// Last path segmentval last = uri?.lastPathSegment // "123"
// Query parametersval name = uri?.getQueryParameter("name") // "John"val allParams = uri?.queryParameterNames // Set of all param keys