Stay organized with collections
Save and categorize content based on your preferences.
The guidelines on this page help you evaluate your app as you make updates to
support the latest location features and behavior.
Test how your app handles approximate location
To evaluate whether you need to update your app to support user-configurable
location accuracy, complete the tests described in this section.
Handle approximate location request from dialog
To check how your app handles a user's request for your app to have approximate
location access from the dialog, do the following:
Request both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION.
In the dialog that appears, where the user can request approximate
location, select
Approximate near the top, and either While using the app or Only this
time near the bottom.
Check whether your app's use cases still work as expected, even when your app
only has approximate location access.
Handle approximate location downgrade from system settings
Figure 1. An app's location permissions screen in system
settings includes Use precise location. This option is independent
from the location access settings that appear closer to the top of the
screen.
To check how your app handles a user's request to change your app's location
access from precise to approximate in system settings, do the following:
Request both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION.
In the dialog that appears, where the user can request approximate
location, select
Precise near the top, and either While using the app or Only this
time near the bottom.
Navigate to your app's permissions screen in system settings.
On the location permission screen, turn off Use precise location. This
option appears in figure 1.
As with any permission downgrade, the system restarts your app's process.
Check whether your app's use cases still work as expected, even when your app
only has approximate location access.
Handle precise location upgrade from system settings
To check how your app handles a user's request to change your app's location
access from approximate to precise in system settings, do the following:
Request both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION.
In the dialog that appears, where the user can request approximate
location, select
Approximate near the top, and either While using the app or Only this
time near the bottom.
Navigate to your app's permissions screen in system settings.
On the location permission screen, turn on Use precise location, as shown
in figure 1.
Because this permission change is an upgrade, the system doesn't restart
your app.
Check whether your app receives more accurate location data in its
location-based use cases.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-11-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-01 UTC."],[],[],null,["# Test your app's location workflows\n\nThe guidelines on this page help you evaluate your app as you make updates to\nsupport the latest location features and behavior.\n\nTest how your app handles approximate location\n----------------------------------------------\n\nTo evaluate whether you need to update your app to support user-configurable\nlocation accuracy, complete the tests described in this section.\n\n### Handle approximate location request from dialog\n\nTo check how your app handles a user's request for your app to have approximate\nlocation access from the dialog, do the following:\n\n1. Request both `ACCESS_FINE_LOCATION` and `ACCESS_COARSE_LOCATION`.\n2. In the dialog that appears, where the user can [request approximate\n location](/training/location/permissions#approximate-request), select **Approximate** near the top, and either **While using the app** or **Only this\n time** near the bottom.\n3. Check whether your app's use cases still work as expected, even when your app only has approximate location access.\n\n### Handle approximate location downgrade from system settings\n\n**Figure 1.** An app's location permissions screen in system settings includes **Use precise location**. This option is independent from the location access settings that appear closer to the top of the screen.\n\nTo check how your app handles a user's request to change your app's location\naccess from precise to approximate in system settings, do the following:\n\n1. Request both `ACCESS_FINE_LOCATION` and `ACCESS_COARSE_LOCATION`.\n2. In the dialog that appears, where the user can [request approximate\n location](/training/location/permissions#approximate-request), select **Precise** near the top, and either **While using the app** or **Only this\n time** near the bottom.\n3. Navigate to your app's permissions screen in system settings.\n4. On the location permission screen, turn off **Use precise location** . This\n option appears in figure 1.\n\n As with any permission downgrade, the system restarts your app's process.\n5. Check whether your app's use cases still work as expected, even when your app\n only has approximate location access.\n\n### Handle precise location upgrade from system settings\n\nTo check how your app handles a user's request to change your app's location\naccess from approximate to precise in system settings, do the following:\n\n1. Request both `ACCESS_FINE_LOCATION` and `ACCESS_COARSE_LOCATION`.\n2. In the dialog that appears, where the user can [request approximate\n location](/training/location/permissions#approximate-request), select **Approximate** near the top, and either **While using the app** or **Only this\n time** near the bottom.\n3. Navigate to your app's permissions screen in system settings.\n4. On the location permission screen, turn on **Use precise location** , as shown\n in figure 1.\n\n Because this permission change is an *upgrade*, the system doesn't restart\n your app.\n5. Check whether your app receives more accurate location data in its\n location-based use cases."]]