Challenge - 5 Problems
Deep Link Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ ui_behavior
intermediate2:00remaining
What happens when a deep link is triggered?
Consider an Android app with a deep link configured to open a specific screen. What is the expected behavior when the deep link URL is clicked?
Attempts:
2 left
💡 Hint
Think about what deep links are designed to do: take users straight to content.
✗ Incorrect
Deep links allow an app to open directly to a specific screen or content when a URL is clicked, bypassing the launcher or home screen.
🧠 Conceptual
intermediate2:00remaining
Which AndroidManifest.xml element defines a deep link?
In Android development, which element inside the AndroidManifest.xml file is used to declare a deep link for an activity?
Attempts:
2 left
💡 Hint
Deep links are triggered by intents targeting activities.
✗ Incorrect
Deep links are declared inside an of an activity with action VIEW and data URI patterns.
❓ lifecycle
advanced2:00remaining
What lifecycle method is called when an activity is opened via a deep link?
When an Android activity is opened through a deep link while the app is already running, which lifecycle method is called to handle the new intent?
Attempts:
2 left
💡 Hint
Think about how Android delivers new intents to existing activities.
✗ Incorrect
If the activity is already running, Android calls onNewIntent() to deliver the new deep link intent.
🔧 Debug
advanced2:00remaining
Why does this deep link not open the app?
An app has this intent filter in AndroidManifest.xml:
Clicking the URL http://example.com/open/page does not open the app. Why?
Attempts:
2 left
💡 Hint
Check how pathPrefix matching works in Android deep links.
✗ Incorrect
The pathPrefix attribute matches the specified prefix and any subpaths, so "/open/page" matches "/open" prefix.
expert
3:00remaining
How to handle multiple deep links with different parameters in one activity?
You want one activity to handle deep links like myapp://product/123 and myapp://category/456. How should you configure the intent filter and handle navigation in Kotlin?
Android Kotlin
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val data = intent?.data
when {
data?.pathSegments?.getOrNull(0) == "product" -> {
val productId = data.pathSegments[1]
// Navigate to product screen with productId
}
data?.pathSegments?.getOrNull(0) == "category" -> {
val categoryId = data.pathSegments[1]
// Navigate to category screen with categoryId
}
}
}Attempts:
2 left
💡 Hint
One activity can handle multiple deep link paths by parsing the URI.
✗ Incorrect
A single intent filter with scheme 'myapp' can handle all deep links; inside the activity, parse the URI path to navigate.