0
0
Android Kotlinmobile~20 mins

Why runtime permissions protect user privacy in Android Kotlin - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Runtime Permissions Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2: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?
ATo let users decide when to allow access to sensitive data or features, improving privacy control.
BTo make the app load faster by delaying permission checks until needed.
CTo reduce the app size by downloading permissions separately.
DBecause Android does not support permissions declared in the app manifest anymore.
Attempts:
2 left
💡 Hint
Think about how users can control what data apps can access.
ui_behavior
intermediate
2: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?
AThe app automatically requests the permission again until the user accepts.
BThe app crashes immediately because it cannot access the denied feature.
CThe app continues without the feature that needs the permission, possibly showing a message explaining the limitation.
DThe app disables all functionality and closes.
Attempts:
2 left
💡 Hint
Consider how apps handle missing permissions gracefully.
lifecycle
advanced
2:00remaining
When should an app request runtime permissions?
At which point in the app lifecycle is it best practice to request a runtime permission?
AImmediately when the app starts, before showing any UI.
BRight before the app needs to use the feature that requires the permission.
COnly after the user has used the app for more than 5 minutes.
DAfter the app has crashed once due to missing permission.
Attempts:
2 left
💡 Hint
Think about when the user expects to grant access.
🔧 Debug
advanced
2: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()
}
AThe app calls startCamera() even when permission is not granted, causing a crash.
BThe permission check uses the wrong constant for CAMERA permission.
CThe app should request permission inside the else block before starting the camera.
DThe app needs to check permission in onCreate(), not here.
Attempts:
2 left
💡 Hint
Look at what happens when permission is denied.
navigation
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?
AKeep requesting the permission every time the app starts until the user accepts.
BDisable the app permanently without informing the user.
CRestart the app automatically to reset permission requests.
DShow a dialog explaining the permission is needed and provide a button to open the app settings screen.
Attempts:
2 left
💡 Hint
Think about how users can manually change permissions after blocking requests.