Runtime permissions are permissions that an app requests from the user while the app is running, not just at install time. This lets users decide if they want to allow access to sensitive data or features.
Click to reveal answer
beginner
Why do runtime permissions improve user privacy?
They let users control when and how apps access sensitive information, like location or contacts, preventing apps from accessing data without user consent.
Click to reveal answer
beginner
When does an Android app request runtime permissions?
An app requests runtime permissions only when it needs to use a feature that requires permission, such as accessing the camera or microphone, making the request relevant and timely.
Click to reveal answer
beginner
What happens if a user denies a runtime permission?
The app cannot use the feature that requires that permission. The user can later change this decision in the device settings if they want to allow it.
Click to reveal answer
intermediate
How do runtime permissions differ from install-time permissions?
Install-time permissions are granted when the app is installed, without asking again. Runtime permissions ask the user during app use, giving more control and transparency.
Click to reveal answer
What is the main purpose of runtime permissions in Android?
ATo let users control app access to sensitive data during app use
BTo speed up app installation
CTo allow apps to access all device features automatically
DTo prevent apps from running in the background
✗ Incorrect
Runtime permissions let users decide when apps can access sensitive features, protecting privacy.
When does an app request a runtime permission?
AOnly when the app is installed
BWhen the app needs to use a feature requiring permission
CEvery time the device is restarted
DOnly when the user opens device settings
✗ Incorrect
Apps ask for runtime permissions only when they need to use a feature that requires it.
What can a user do if they deny a runtime permission?
AChange the permission later in device settings
BNothing, the decision is permanent
CUninstall the app automatically
DForce the app to close
✗ Incorrect
Users can always change permission decisions later in the device settings.
Which of these is NOT a benefit of runtime permissions?
AImproved user privacy
BUser control over sensitive data
CApps get all permissions by default
DTransparency about app access
✗ Incorrect
Runtime permissions prevent apps from getting all permissions by default.
How do runtime permissions protect user privacy?
ABy hiding app data from the user
BBy automatically granting all permissions
CBy blocking all app features
DBy asking user consent before accessing sensitive features
✗ Incorrect
Runtime permissions ask users for consent, protecting their privacy.
Explain how runtime permissions help protect user privacy in Android apps.
Think about when and why the app asks for permissions.
You got /4 concepts.
Describe the difference between install-time permissions and runtime permissions.
Consider when the user is asked to grant permissions.
You got /4 concepts.
Practice
(1/5)
1. Why do Android apps request runtime permissions instead of asking for all permissions at install time?
easy
A. To protect user privacy by asking only when the permission is needed
B. To make the app install faster
C. To reduce the app size
D. To avoid asking the user any questions
Solution
Step 1: Understand runtime permissions purpose
Runtime permissions ask users only when a feature needs access, protecting privacy.
Step 2: Compare with install-time permissions
Install-time permissions ask all at once, which can overwhelm users and reduce control.
Final Answer:
To protect user privacy by asking only when the permission is needed -> Option A
Quick Check:
Runtime permissions = protect privacy [OK]
Hint: Runtime permissions ask only when needed, protecting privacy [OK]
Common Mistakes:
Thinking runtime permissions speed up installation
Believing runtime permissions reduce app size
Assuming runtime permissions avoid user prompts
2. Which Kotlin code snippet correctly checks if the app has permission to access the camera before requesting it?
easy
A. if (checkPermission(Manifest.permission.CAMERA)) { /* permission granted */ }
B. if (hasPermission(Manifest.permission.CAMERA)) { /* permission granted */ }
C. if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { /* permission granted */ }
D. if (requestPermission(Manifest.permission.CAMERA)) { /* permission granted */ }
Solution
Step 1: Identify correct permission check method
ContextCompat.checkSelfPermission returns permission status in Android Kotlin.
Step 2: Verify correct comparison
Compare result to PackageManager.PERMISSION_GRANTED to confirm permission granted.
Final Answer:
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { /* permission granted */ } -> Option C
Quick Check:
Use ContextCompat.checkSelfPermission == PERMISSION_GRANTED [OK]
Hint: Use ContextCompat.checkSelfPermission with PERMISSION_GRANTED check [OK]
Common Mistakes:
Using non-existent methods like checkPermission or hasPermission
Calling requestPermission instead of checking permission
Not comparing to PERMISSION_GRANTED constant
3. Given this Kotlin code snippet, what will be the output if the user denies the permission request?