Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Android 6.0 Marshmallow (M, API 23) introduced runtime requests for dangerous permissions. If your app targets API 23 or higher and runs on Android 6.0 or later, check permission state when a feature needs protected access, request permission at that point, and handle either outcome. Android 7.0 Nougat (N, API 24) did not replace that request flow; its related permission changes concern file access and sharing.

What changed in Android M—and what did not change in N

Before Android 6.0, users generally granted an app’s declared permissions during installation. With the runtime model, users can manage dangerous permissions after installation. For apps targeting API 23 or later, Android 6.0 and later require the app to check and request dangerous permissions as needed. Android’s current guide says apps installed on Android 5.1 (API 22) or lower receive permissions automatically under this workflow. The Android 6.0 testing guide also notes that the change affects apps running on Android 6.0 even if they do not target it; legacy compatibility behavior is limited, so testing the runtime flow is preferable to relying on that behavior. See Android 6.0 Changes and the Android 6.0 Testing Guide.

Android 7.0 is API 24. Its behavior-change documentation does not describe a new runtime permission-request sequence. Instead, it addresses private app file access and inter-app file sharing: apps targeting Android 7.0 should share files with content:// URIs and temporary access grants, commonly using FileProvider. Exposing a file:// URI outside the app can trigger FileUriExposedException. These are related security changes, not additional steps in the runtime permission flow. See Android 7.0 Behavior Changes.

Platform Relevant change What to do
Android 6.0 M (API 23) Introduced runtime management of dangerous permissions for apps targeting API 23 or later. Declare the permission, check it when the feature needs access, request it if needed, and handle the result.
Android 7.0 N (API 24) No new runtime-request sequence is documented; relevant permission changes concern file access and URI sharing. Use content URIs with temporary grants when sharing files between apps; do not expose file URIs.

Request a dangerous permission when a feature needs it

First decide whether the feature truly needs protected data or a system resource; some use cases can avoid a permission request. If access is necessary, connect the request to a user-understood action, such as starting the feature that needs it. Declare the permission in the manifest, but do not treat that declaration as a grant. Check the current state before each protected operation because a previous grant may have been revoked.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
  1. Declare the permission. Add the required permission to the app manifest.
  2. Check the current grant. Use ContextCompat.checkSelfPermission() before accessing the protected resource.
  3. Explain when appropriate. If access is denied, call ActivityCompat.shouldShowRequestPermissionRationale(). When it indicates that an explanation is appropriate, explain what the feature needs and why, and give the user a way to cancel.
  4. Request access. Prefer AndroidX’s RequestPermission or RequestMultiplePermissions activity-result contracts when possible. The request-code approach and onRequestPermissionsResult() are documented alternatives.
  5. Handle the result. Continue the requested task if access is granted. If it is denied, communicate what the feature cannot do and let the user continue using the rest of the app where possible.

The system dialog identifies the permission being requested; it does not explain why your particular feature needs it. The explanation, when appropriate, is the app’s responsibility. Follow Android’s runtime permission request guide for the API details.

Make denial and revocation safe

A permission is not a one-time assumption that can be carried forward indefinitely. Check it again before protected work, and make the app behave sensibly if the user denies the request or later revokes access in Settings. Avoid blocking unrelated parts of the app when only one feature depends on that permission. Android’s permission best practices recommend requesting access in context and gracefully handling refusal.

Rank #2
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.
  • Continue without the protected feature when practical.
  • Tell the user what capability is unavailable rather than presenting an unexplained failure.
  • Do not repeatedly request access without regard to the user’s choice; provide an appropriate path back to the feature or settings when needed.

Test grants, denials, and permission changes

Android’s Android 6.0 testing guidance recommends identifying permission declarations and the code paths that use them, exercising those user flows, and testing combinations of granted and revoked permissions. During migration testing, target API 23 so the app opts into runtime behavior. Use an emulator or device to verify the actual feature behavior for each relevant state; the commands below help inspect or change permissions during testing.

  • adb shell pm list permissions -d -g lists dangerous permissions by group.
  • adb shell pm grant <permission.name> grants a permission for testing.
  • adb shell pm revoke <permission.name> revokes a permission for testing.

Test the feature after an initial grant, after denial, and after revocation in Settings. Also verify that a user can cancel an explanatory prompt without leaving the rest of the app unusable. The commands and migration advice are documented in the Android 6.0 Testing Guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Do not build logic around permission groups

Permission groups help Android manage its dialogs, but app behavior should not depend on a permission’s group membership or infer that granting one permission means another is granted. Check each permission your feature needs directly, using Android’s documented grant-state APIs.

Quick Recap

Best Value
Tracfone Moto g Play 2024 Prepaid Phone with a 1-Yr Plan Included
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Activating is easy, just 3 steps.
  • ACTIVATION Promotion: Includes 1500 min, 1500 texts & 1500 MB Data + add more as you need it
  • CAMERA SYSTEM: 50MP Quad Pixel camera. Capture sharper, more vibrant photos day or night with 4x the light sensitivity.
  • PERFORMANCE: Blazing-fast Qualcomm performance. Get the speed you need for great entertainment with a Snapdragon 680 processor and 4GB of RAM.
  • 64GB built-in storage. Get plenty of room for photos, movies, songs, and apps. Made for US
Rank #4
Sale
Samsung Galaxy S26 Ultra, Unlocked Android Smartphone, 512GB, Black
  • PRIVACY DISPLAY: Automatically hide your screen from those beside you. The built-in privacy display can be preset¹ to turn on when receiving notifications, typing passwords, or using specific apps
  • TYPE IT IN. TRANSFORM IT FAST: Enhance any shot in seconds on your smartphone by using Photo Assist² with Galaxy AI.³ Add objects, restore details, or apply new styles by simply typing or tapping
  • NIGHTS, CAPTURED CLEARLY: From gigs to city lights, record and capture moments after dark with clarity using Nightography so your photos and videos stay crisp and clear on your Samsung Galaxy
  • MAKE IT. EDIT IT. SHARE IT: Turn everyday moments into something personal with creative tools built right into your mobile phone, whether it’s a special contact photo, custom wallpaper, an invitation or more⁴
  • HELP THAT KEEPS UP: Stay in the moment while Now Nudge with Galaxy AI helps you respond faster and stay organized with smart suggestions⁵ that appear exactly when you need them on your phone

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.