Challenge - 5 Problems
Biometric Authentication Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ ui_behavior
intermediate1:30remaining
What happens when biometric authentication succeeds?
In an Android app using BiometricPrompt, what is the typical behavior after the user successfully authenticates with fingerprint or face?
Attempts:
2 left
💡 Hint
Think about what the app wants to do after confirming the user is authorized.
✗ Incorrect
When biometric authentication succeeds, the app usually continues to the protected feature or content without interruption.
📝 Syntax
intermediate2:00remaining
Identify the correct way to create a BiometricPrompt.PromptInfo
Which Kotlin code snippet correctly creates a BiometricPrompt.PromptInfo with title "Login" and negative button text "Cancel"?
Attempts:
2 left
💡 Hint
Remember to call Builder() as a function and use the correct setter methods.
✗ Incorrect
The Builder class must be instantiated with parentheses, and the setter methods are setTitle and setNegativeButtonText.
❓ lifecycle
advanced2:00remaining
When should you invalidate the BiometricPrompt callback?
In an Android app using BiometricPrompt, when is the best time to invalidate or cancel the biometric authentication callback to avoid memory leaks?
Attempts:
2 left
💡 Hint
Think about cleaning up resources when the UI component is no longer visible.
✗ Incorrect
To avoid memory leaks, you should cancel or invalidate biometric callbacks in onDestroy() or equivalent lifecycle methods.
🧠 Conceptual
advanced2:00remaining
Why use BiometricPrompt over FingerprintManager?
Why is it recommended to use BiometricPrompt API instead of the older FingerprintManager API in Android apps?
Attempts:
2 left
💡 Hint
Consider the types of biometric authentication supported.
✗ Incorrect
BiometricPrompt is a unified API that supports fingerprint, face, and iris authentication, making it more versatile.
🔧 Debug
expert2:30remaining
What error occurs if you call authenticate() without setting PromptInfo?
Given this Kotlin code snippet:
val biometricPrompt = BiometricPrompt(this, executor, callback)
biometricPrompt.authenticate()
What error will this cause at runtime?
Attempts:
2 left
💡 Hint
Check the required parameters for authenticate() method.
✗ Incorrect
The authenticate() method requires a PromptInfo object; calling it without one throws IllegalArgumentException.