Runtime Permissions Interview Questions

ANDROID › System

How do runtime permissions work on Android?

What a strong answer covers: Since Android 6, dangerous permissions (location, camera, contacts, microphone) must be declared in the manifest and requested at runtime. The user can grant or deny, and can revoke later in settings. Normal permissions like INTERNET are granted automatically at install. Check with checkSelfPermission before using a protected feature.

How would you request a permission in modern Android code, and when should you show a rationale?

What a strong answer covers: Use the Activity Result API: registerForActivityResult(RequestPermission()) or RequestMultiplePermissions, launched in context when the user triggers the feature. If shouldShowRequestPermissionRationale returns true (the user denied once), explain why you need it in your own UI first. In Compose, use rememberLauncherForActivityResult. Never request everything at startup.

What happens after a user denies a permission twice, and how should your app behave?

What a strong answer covers: Since Android 11, two denials count as 'don't ask again', and the system dialog won't show again; the request returns denied immediately. The app should degrade gracefully, keep the rest of the feature working, and if the user explicitly asks for the feature, explain and offer a button to the app's settings page.

What changed for location, notifications, photos and other permissions in recent Android versions?

What a strong answer covers: Android 10 split background location; Android 11 added one-time permissions and auto-reset for unused apps; Android 12 added approximate vs precise location; Android 13 added POST_NOTIFICATIONS and granular media permissions (READ_MEDIA_IMAGES, VIDEO, AUDIO) replacing READ_EXTERNAL_STORAGE; Android 14 added partial photo access (READ_MEDIA_VISUAL_USER_SELECTED). The Photo Picker avoids needing media permissions at all.

How would you design permission handling for a feature that needs background location, so it's accepted on Play and doesn't annoy users?

What a strong answer covers: Ask for foreground location first, in context, explaining the value. Only after it's granted and the user enables the background feature, explain clearly and send them to settings for 'Allow all the time' (Android 11+ won't show it in the dialog). Have a working foreground-only fallback, a prominent disclosure as Play requires, a policy declaration form, and handle approximate-only grants and revocation at any time.

Back to Runtime Permissions