How can we get all installed applications in android 11? for Android 10 it is working fine but when I updated to android 11 then all of them are gone.
Get all installed apps in android 11 (API 30) , how to get all other apps installed in android 11?
7.9k Views Asked by Ali Imran At
2
There are 2 best solutions below
0
On
Update to Above Ali's answer
The queries tag does not work inside the application tag, so you have to add it inside the manifest tag, but outside the application tag like this
<manifest
<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />
<uses-permission
android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
</application>
<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
</intent>
</queries>
</manifest>
From Android 11 Google has introduced a new permission to query all installed apps on android devices. So if you want to get all applications in yours app for some reason then just add following permission in your manifest
or for specific category of apps you can use this in your manifest. for example if you want only apps with
android.intent.category.HOMEcategory then add this code.also you can filter apps more specifically by adding more categories to it like shown below