Sample questions
Question 1Easy
Since which Android version must dangerous permissions be requested at runtime?
- Android 2.3
- Android 10 (API 29)
- Android 6.0 (API 23)
- Android 4.0
Answer: C. Android 6.0 (API 23)
Explanation
Before Marshmallow, all permissions were granted at install time.
Step-by-step solution
- Before Android 6.0, all permissions were granted at install.
- Android 6.0 Marshmallow (API 23) introduced runtime permissions.
- Dangerous permissions are requested while the app is running.
Why the other options are wrong
- A. Android 2.3 still granted everything at install.
- B. Android 10 added background location rules, not runtime permissions.
- D. Android 4.0 had install-time permissions only.
Tip: Runtime permissions = Marshmallow = API 23.
Question 2Easy
Which of these is a runtime (dangerous) permission?
- INTERNET
- VIBRATE
- ACCESS_NETWORK_STATE
- CAMERA
Answer: D. CAMERA
Explanation
INTERNET, network-state and vibrate are normal permissions granted at install.
Step-by-step solution
- Dangerous permissions protect private data or hardware.
- CAMERA gives access to the camera, so it needs runtime approval.
- INTERNET, VIBRATE and ACCESS_NETWORK_STATE are normal permissions.
Why the other options are wrong
- A. INTERNET is a normal permission granted at install.
- B. VIBRATE is normal; it poses no privacy risk.
- C. Reading network state is a normal permission.
Tip: Privacy-sensitive hardware or data = dangerous permission.
Question 3Easy
The INTERNET permission in Android is:
- A normal permission granted at install
- A dangerous permission needing a dialog
- Not needed for network calls
- Only available to system apps
Answer: A. A normal permission granted at install
Explanation
It must be declared in the manifest but is not requested at runtime.
Step-by-step solution
- INTERNET is a normal permission.
- Declaring it in the manifest is enough; it is granted at install.
- No runtime dialog is shown.
Why the other options are wrong
- B. It does not trigger a runtime dialog.
- C. Without it, network calls fail with a security exception.
- D. Any app can declare it.
Tip: INTERNET: declare it, never ask for it.
Question 4Easy
If the user permanently denies a permission, the app should:
- Point the user to settings
- Ask again in a loop
- Crash deliberately
- Hide the app icon
Answer: A. Point the user to settings
Explanation
The system won't show the dialog again, so direct the user to settings if the feature is essential.
Step-by-step solution
- After permanent denial, the system no longer shows the permission dialog.
- Requesting again just fails silently.
- Explain why the feature needs it and offer a button to open the app's Settings page.
Why the other options are wrong
- B. The dialog will not appear again, and a loop annoys the user.
- C. Crashing is never acceptable.
- D. Apps cannot hide their own launcher icon for this purpose.
Tip: Permanently denied -> explain + link to Settings.
Question 5Medium
Since Android 12, when an app requests ACCESS_FINE_LOCATION, the user can choose:
- GPS or Wi-Fi hardware
- Only allow or crash
- City name only
- Precise or approximate
Answer: D. Precise or approximate
Explanation
Apps should work gracefully with approximate (coarse) location if the user chooses it.
Step-by-step solution
- Since Android 12, the location dialog shows two choices.
- The user can grant precise or approximate location.
- Apps must handle receiving only approximate (coarse) location.
Why the other options are wrong
- A. The user does not choose GPS or Wi-Fi hardware.
- B. Denying does not crash the app; there are several choices.
- C. There is no 'city name only' option.
Tip: Android 12: precise vs approximate.
Question 6Medium
To let a user pick a photo without requesting storage permissions, a modern app should use:
- Root access
- The system photo picker
- A custom file scanner
- READ_EXTERNAL_STORAGE always
Answer: B. The system photo picker
Explanation
The photo picker grants access only to the chosen items.
Step-by-step solution
- The system photo picker (PickVisualMedia) lets the user choose specific images.
- The app gets access only to what was picked.
- No storage permission is needed.
Why the other options are wrong
- A. Root access is not available on normal phones and is unsafe.
- C. Scanning files yourself needs broad storage permission.
- D. READ_EXTERNAL_STORAGE gives broad access and is restricted on newer Android.
Tip: Pick a photo = photo picker, no permission.
Question 7Medium
Which modern API is recommended for requesting a permission from an Activity or composable?
- ActivityResultContracts.RequestPermission
- Settings.ACTION_SETTINGS
- startActivityForResult with a code
- onRequestPermissionsResult only
Answer: A. ActivityResultContracts.RequestPermission
Explanation
In Compose use rememberLauncherForActivityResult with that contract.
Step-by-step solution
- The Activity Result API replaced the old request-code callbacks.
registerForActivityResult(ActivityResultContracts.RequestPermission()) gives a launcher.- In Compose,
rememberLauncherForActivityResult does the same.
Why the other options are wrong
- B. This opens the Settings app; it does not request a permission.
- C. startActivityForResult with request codes is the deprecated older approach.
- D. onRequestPermissionsResult belongs to the old requestPermissions flow.
Tip: Permission in modern code = ActivityResultContracts.RequestPermission.
Question 8Medium
shouldShowRequestPermissionRationale() returns true when:
- The device has no camera
- The permission is already granted
- The user denied it before
- The app was just installed and never asked
Answer: C. The user denied it before
Explanation
It signals that an educational UI should explain the benefit before asking again.
Step-by-step solution
- The method tells you whether to explain why you need the permission.
- It returns true after the user has denied the request at least once (without 'don't ask again').
- It returns false on the first request and after permanent denial.
Why the other options are wrong
- A. It says nothing about hardware.
- B. If already granted, no rationale is needed, so it returns false.
- D. Before the first request it returns false.
Tip: Denied once = show rationale.
Question 9Medium
Which check tells you whether a permission is currently granted?
Manifest.hasPermission()requestPermissions() returning truecheckSelfPermission(...) == PERMISSION_GRANTEDpermission.isEnabled()
Answer: C. checkSelfPermission(...) == PERMISSION_GRANTED
Explanation
ContextCompat.checkSelfPermission returns PERMISSION_GRANTED or PERMISSION_DENIED.
Step-by-step solution
- ContextCompat.checkSelfPermission(context, permission) returns an int.
- Compare it with PackageManager.PERMISSION_GRANTED.
- If equal, the permission is granted now.
Why the other options are wrong
- A. There is no Manifest.hasPermission() method.
- B. requestPermissions() shows a dialog and returns nothing.
- D. Permission strings have no isEnabled() method.
Tip: Always check right before using the feature.
Question 10Hard
An app needs location while running in the background on Android 10+. What is required?
- No permission at all
- Only ACCESS_COARSE_LOCATION at install
- Only INTERNET
- ACCESS_BACKGROUND_LOCATION too
Answer: D. ACCESS_BACKGROUND_LOCATION too
Explanation
Background location is a separate permission, requested after foreground location is granted.
Step-by-step solution
- On Android 10+, foreground location permissions cover use while the app is visible.
- Background use needs ACCESS_BACKGROUND_LOCATION as well.
- It must be requested separately, after foreground location is granted.
Why the other options are wrong
- A. Location always needs permission.
- B. Coarse location alone covers foreground use only.
- C. INTERNET has nothing to do with location access.
Tip: Background location on Android 10+ = separate permission.
Practise all 14 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →