Class for retrieving various kinds of information related to the application packages that are currently installed on the device. You can find this class through getPackageManager().
Questions tagged [android-package-managers]
561 questions
4
votes
2 answers
Android Pay - How to detect if Android Pay is installed?
There is this code (taken from https://stackoverflow.com/a/5016624/1369016):
private boolean isAppInstalled(String packageName) {
PackageManager pm = getPackageManager();
boolean installed = false;
try {
pm.getPackageInfo(packageName,…

Bitcoin Cash - ADA enthusiast
- 11,457
- 16
- 83
- 103
4
votes
1 answer
Samsung disable packages
I'm trying to create a kiosk mode application for my company and I need to disable some default packages to avoid the users to reach it.
I've using Samsung Knox which looks to be working well when this code is not executed.
The list is huge:
//…

Manitoba
- 8,522
- 11
- 60
- 122
4
votes
0 answers
Android: Broadcast receiver for any app launch or if any app comes to foreground
I have a service which has to monitor which application is in the foreground and based on the application do some functionality.
I can get the list of foreground applications, using ActivityManager.getRunningAppProcesses(). But with this I cannot…

Karthik Andhamil
- 92
- 6
4
votes
2 answers
How to get list of ALL apps (including System Apps)?
I am doing the following to get the list of apps and I am only getting apps that were installed but not ALL apps, including system apps.
I have tried the following:
packageList1 =…

user1406716
- 9,565
- 22
- 96
- 151
4
votes
1 answer
What's the difference between "getApplicationLabel" and "loadLabel"?
Background
I'm working on my app that is an alternative to the app manager (link here), and wish to optimize it a bit.
As it turns out, one of the slowest things on the app is its bootup, and the main reason for this is getting the app name . I…

android developer
- 114,585
- 152
- 739
- 1,270
4
votes
1 answer
Aidl code linking for Package Manager in Android
I've been trying to figure out how an android app is installed by browsing AOSP.
The PackageManagerService.java has the gids for the corresponding permissions by parsing the platform.xml file.
PackageInstallerActivity parses and checks for any…

Adi GuN
- 1,244
- 3
- 16
- 38
4
votes
1 answer
Opening PDF externally with Polaris office 5 returns "This document cannot be opened"
We've been trying to solve this issue for the past few hours, finally decided we should revert to StackOverflow.
Here goes -
We have an application that downloads a PDF file from a server to the app's cache directory and then opens it using the…

Dan
- 872
- 10
- 24
4
votes
0 answers
How does getPreferredActivities() work?
I find it not so clear as to how getPreferredActivities works.
For example, can getPreferredActivities return more than one item in case I ask it to return the default app of specific type?
I think it's supposed to return the default activity for…

android developer
- 114,585
- 152
- 739
- 1,270
4
votes
1 answer
How to use default Package Installer (Android) when trying to install an APK from another app?
I have been trying to install other apps from my app. I have downloaded the .apk from the server and I am firing an intent with the following content
Intent installIntent = new…

Akh
- 5,961
- 14
- 53
- 82
4
votes
1 answer
part-2 persistent foreGround android service that starts by UI, works at sleep mode too, also starts at phone restart
Status: Really thankful to all who helped and guided here and in part-1! I have made code out of research and help given and have put that working code in EDIT-1. Criticisms are welcomed to make the code better.
Scenario:
I asked the question…

Masood Ahmad
- 731
- 4
- 15
- 38
4
votes
1 answer
How to construct package URI using PackageManager in android
I need to construct PackageUri in order to uninstall package using action.delete. I obtained PackageInfo object using PackageMananger. Is there any way to construct PackageUri using PackageInfo?
thanks.

SohailAziz
- 8,034
- 6
- 41
- 43
4
votes
2 answers
How to pull List of installed App name, package name and icon drawable
I'm trying to figure out how i can implement this code into my existing source code. Currently i have some source that displays a list-view of all the installed apps and on-click will send intent to the application. I'm needing some support on how…

Jaison Brooks
- 5,816
- 7
- 43
- 79
3
votes
1 answer
Android PackageManager: check if a library APK has been installed
The PackageManager.getPackageInfo(packageName, flags) method can be used to check whether a specific package has been installed. It either returns the PackageInfo or throws PackageManager.NameNotFoundException.
How to check if a library APK is…

vmayorow
- 630
- 5
- 15
3
votes
1 answer
How to filter installed Games on Android only?
Here it is described, how to get a list of all installed apps on Android by using the PackageManager.
I would like to get this complete list, filtered by all installed "Games". How can I filter all installed apps for category "Games"

Ralf Wickum
- 2,850
- 9
- 55
- 103
3
votes
5 answers
Android studio is making used import statement as unused?
I have just starting working my android studio project in another pc with same android studio version and it automatically makes used import statement as unused in the code and mark evey code related to particular import statement red. How can i fix…

tomtom
- 345
- 2
- 15