Package Visibility in Android

Updated 30 July 2021

Save

Android 11 introduces various changes to strengthen the privacy of the user using the respected app and, also introduces changes related to package visibility on how your apps query and interact with the other apps installed on a device.

The Apps must have to use the <queries> element to define other packages that the app wants to interact with.

Before Android 11, the applications used to obtain the list of all installed applications using methods such as queryIntentActivities() but this lists all the app.

The filtering of the package helps to reduce the information that your app doesn’t require, but that your app can still access it.

Query Intent Filter

Your app might need to query or interact with a set of apps that are serving a specific purpose (like using mail, browsing), but you might not know the specific package names to be included.

In this case, you can use intent filter <intent-filter> tag in your <queries> element.

You can check the below example:

Specific package names

In the Manifest, You have to use the <queries> element and, if you have any specific package your app wants to query then you have to add it like the below code.

All apps query

This permission is the recommended way but if, your app needs to query/interact with all installed applications regardless of the components they have.

You can allow your app to see all other installed apps, then you need to add QUERY_ALL_PACKAGES permission.

You can also check out the official documentation provided by Google click here.

. . . . . . . . .

That’s it from my side for today, thanks for reading it until now. You can check our other android blogs Click Here.

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home