Document Location SDK for Android Guides Utility Tools Android 12 Permissions

Android 12 Permissions

Approximate Location

Android 12 introduces a new approximate location feature that gives users more granular control over how apps access their device location.

Permission Usage

Runtime Requests

Requesting Location Permissions

When your app targets Android 12 (API level 31) or higher, users can request that your app access only approximate location information.

If you request the ACCESS_FINE_LOCATION runtime permission, you must also request the ACCESS_COARSE_LOCATION permission.

Important: Do not request ACCESS_FINE_LOCATION alone. If you attempt to request only ACCESS_FINE_LOCATION, the system may ignore the request on certain Android 12 versions. When your app targets Android 12 or higher, the system logs the following error message in Logcat:

ACCESS_FINE_LOCATION must be requested with ACCESS_COARSE_LOCATION.

When your app requests only ACCESS_COARSE_LOCATION, the system displays the dialog shown in Figure 1:

Android 12 location permission dialog showing approximate and precise location options for an AMAP Location SDK app

*Figure 1*

When your app requests both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION, the system permission dialog provides the following options, as shown in Figure 2:

Precise location: Allows your app to access exact location information.

Approximate location: Allows your app to access only approximate location information.

Android 12 approximate location permission dialog explaining the app will receive only approximate location data

*Figure 2*

Requesting an Upgrade to Precise Location

To request that the user upgrade your app's location access from approximate to precise, follow these steps:

1. If necessary, explain why your app needs the precise location permission.

2. Request both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION permissions again. Because the user has already granted approximate location access, the system dialog now appears differently, as shown in Figures 3 and 4:

Android 12 permission upgrade dialog shown when the user previously granted approximate location and the app requests precise access

*Figure 3. User previously selected Approximate location and While using the app*

Android 12 permission dialog with Approximate location and While using the app pre-selected from a previous grant

*Figure 4. User previously selected Approximate location and Only this time*

System Settings

On Android 12 and higher, users can navigate to system settings to set the preferred location accuracy for any app, regardless of the app's target SDK version. This also applies if your app is installed on a device running Android 11 or lower, and the user later upgrades the device to Android 12 or higher.

Note: If the user downgrades your app's location access from precise to approximate—either from the permission dialog or in system settings—the system restarts your app's process.

Android system settings screen showing the location permission options where users can toggle between precise and approximate access

Accuracy Levels

Approximate Location

Provides an estimated device location, typically within approximately 1.6 kilometers (1 mile). Your app uses this level of location accuracy when you declare the ACCESS_COARSE_LOCATION permission (without ACCESS_FINE_LOCATION).

Precise Location

Provides the most accurate device location estimate available, typically within approximately 50 meters (160 feet), and sometimes within a few meters (10 feet). Your app uses this level of location accuracy when you declare the ACCESS_FINE_LOCATION permission.

If the user grants only approximate location permission, your app can access only approximate location information, regardless of which location permissions it declares.

Your app should continue to function normally when the user grants only approximate location access. If a specific feature in your app requires precise location via the ACCESS_FINE_LOCATION permission, you can request that the user allow your app to access precise location.