Giving users more control over their location data
Source: Giving users more control over their location data from Android Developer
Posted by Jen Chai, Product Manager
Location data can deliver amazing, rich mobile experiences for users on Android such as finding a restaurant nearby, tracking the distance of a run, and getting turn-by-turn directions as you drive. Location is also one of the most sensitive types of personal information for a user. We want to give users simple, easy-to-understand controls for what data they are providing to apps, and yesterday, we announced in Android Q that we are giving users more control over location permissions. We are delighted by the innovative location experiences you provide to users through your apps, and we want to make this transition as straightforward for you as possible. This post dives deeper into the location permission changes in Q, what it may mean for your app, and how to get started with any updates needed.
Previously, a user had a single control to allow or deny an app access to device location, which covered location usage by the app both while it was in use and while it wasn’t. Starting in Android Q, users have a new option to give an app access to location only when the app is being used; in other words, when the app is in the foreground. This means users will have a choice of three options for providing location to an app:
- “All the time” – this means an app can access location at any time
- “While in use” – this means an app can access location only while the app is being used
- “Deny” – this means an app cannot access location
Some apps or features within an app may only need location while the app is being used. For example, if a feature allows a user to search for a restaurant nearby, the app only needs to understand the user’s location when the user opens the app to search for a restaurant.
However, some apps may need location even when the app is not in use. For example, an app that automatically tracks the mileage you drive for tax filing, without requiring you to interact with the app.
The new location control allows users to decide when device location data is provided to an app and prevents an app from getting location data that it may not need. Users will see this new option in the same permissions dialog that is presented today when an app requests access to location. This permission can also be changed at any time for any app from Settings-> Location-> App permission.
Here’s how to get started
We know these updates may impact your apps. We respect our developer community, and our goal is to approach any change like this very carefully. We want to support you as much as we can by (1) releasing developer-impacting features in the first Q Beta to give you as much time as possible to make any updates needed in your apps and (2) providing detailed information in follow-up posts like this one as well as in the developer guides and privacy checklist. Please let us know if there are ways we can make the guides more helpful!
If your app has a feature requiring “all the time” permission, you’ll need to add the new
ACCESS_BACKGROUND_LOCATION permission to your manifest file when you target Android Q. If your app targets Android 9 (API level 28) or lower, the
ACCESS_BACKGROUND_LOCATION permission will be automatically added for you by the system if you request either
ACCESS_COARSE_LOCATION. A user can decide to provide or remove these location permissions at any time through Settings. To maintain a good user experience, design your app to gracefully handle when your app doesn’t have background location permission or when it doesn’t have any access to location.
Users will also be more likely to grant the location permission if they clearly understand why your app needs it. Consider asking for the location permission from users in context, when the user is turning on or interacting with a feature that requires it, such as when they are searching for something nearby. In addition, only ask for the level of access required for that feature. In other words, don’t ask for “all the time” permission if the feature only requires “while in use” permission.
To learn more, read the developer guide on how to handle the new location controls.
ZTE is giving developers a head start on making LineageOS 15 for the Axon 7 by providing early access to kernel sources and the Android Oreo ROM.
Earlier this month Microsoftannounced plans to buy the code-hosting and collaboration site GitHub for $7.5 billion. It's hard to overstate how important GitHub is to modern software development. The serv...
Everyone likes free money, and you can maybe get some of that right now in the Play Store client on your phone. We've gotten numerous reports of a free cre... by Ryan Whitwam in Applications, Games, Google, News, Pixel 3, Pixel 3 XL
By virtue of using LLVM, Mono has access to a wide suite of tools and optimization backends. A lot of active research uses LLVM IR. One such research project, Souper, tries to brute-force a search for missed optimizations...
Giving up on wlroots-rs Way Cooler is a Wayland compositor that was written in Rust using wlc . Since...
A zero. A failure. That was the result of my first pilot run. The launch of my company. After spending few months building an “order on your phone” solution and closing a customer, we had our big day, of getting the pro...
Posts and writings by Lennart Poettering
Post with 217 views. Firefox users of all countries, unite!
Apple was forced to release iOS 11.2 on Saturday, which was a little earlier than planned, due to a software bug. Now, Apple Pay Cash — one of the marquee features of the update — is being...