Location Permission in Android 10
As Android 10 has introduced, the dialog UI as well as handling the location permission has updated. Now, the user has right to allow/disallow that the app can fetch location while it is in background. To accomplish this, a new permission has to be declared in the manifest file: android.permission.ACCESS_BACKGROUND_LOCATION Calling this would pop up a dialog with basically three options: Always Allow Allow only while using the app Deny Along with these options, there are some other scenarios i.e. On selecting Deny will give a new option Deny & Do not ask again Or, if user selects ' Allow only while using the app ', the next time the app is launched, it will only ask the user to allow the Location Permission or deny . User can choose this option to optimize the battery consumption as some of the apps use location updates even when the app is in background or service might be running even if the appis killed. Lets take a simple example of a share cab ap...