Challenge - 5 Problems
Runtime Permissions Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why do Android apps request permissions at runtime?
Which reason best explains why Android apps ask for permissions while the app is running instead of only at install time?
Attempts:
2 left
💡 Hint
Think about how users can control what data apps can access.
✗ Incorrect
Runtime permissions let users approve or deny access to sensitive features like camera or location only when the app needs them, giving users more control and protecting their privacy.
❓ ui_behavior
intermediate2:00remaining
What happens if a user denies a runtime permission?
When an Android app requests a runtime permission and the user denies it, what is the typical app behavior?
Attempts:
2 left
💡 Hint
Consider how apps handle missing permissions gracefully.
✗ Incorrect
Apps should handle denied permissions by disabling or hiding features that require them and informing the user, instead of crashing or forcing permission acceptance.
❓ lifecycle
advanced2:00remaining
When should an app request runtime permissions?
At which point in the app lifecycle is it best practice to request a runtime permission?
Attempts:
2 left
💡 Hint
Think about when the user expects to grant access.
✗ Incorrect
Requesting permissions just before using the related feature helps users understand why the permission is needed and improves trust.
🔧 Debug
advanced2:00remaining
Identify the cause of a permission denial crash
This Kotlin code snippet crashes when accessing the camera. What is the cause?
Android Kotlin
if (checkSelfPermission(Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { startCamera() } else { startCamera() }
Attempts:
2 left
💡 Hint
Look at what happens when permission is denied.
✗ Incorrect
The code calls startCamera() regardless of permission status, so if permission is denied, the app tries to access the camera and crashes.
expert
3:00remaining
How to handle permission denial with 'Don't ask again' selected?
If a user denies a runtime permission and selects 'Don't ask again', what is the best way for the app to let the user enable the permission later?
Attempts:
2 left
💡 Hint
Think about how users can manually change permissions after blocking requests.
✗ Incorrect
When 'Don't ask again' is selected, the app cannot request permission again programmatically. The user must go to app settings to enable it.