Questions tagged [android-package-managers]

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().

561 questions
6
votes
1 answer

Call broadcast receiver at time of uninstalling application in android

I want to clean up the junk created by my application at time on UnInstalling the Application. Using ManiFest File:- Added in Manifest File:
Vikalp Patel
  • 10,669
  • 6
  • 61
  • 96
6
votes
1 answer

Way to get localized label name from PackageManager

I am using PackageManager.getApplicationLabel(ApplicationInfo) to get the application name. But this name may change according to the device locale configuration and application resource string. So I wonder if there is any convenient way to get a…
mianlaoshu
  • 2,342
  • 3
  • 27
  • 48
6
votes
1 answer

Why would Activity.getPackageManager() return null

I have method that resolves an Intent to a ComponentName: private static ComponentName resolveViewExternalIntent(Context context) { Intent intent = createIntent(); return intent.resolveActivity(context.getPackageManager()); } Rarely, I get…
6
votes
1 answer

Android ADB Shell doesn't enable packages

I ask to pm (package manager) to enable some package, but it doesn't enable and shows the message "new state: disabled" shell@android:/ $ pm enable my.app.com Package my.app.com new state: disabled Weird... It seems to be a bug... Samsung…
CelinHC
  • 1,857
  • 2
  • 27
  • 36
6
votes
2 answers

Is there a way to keep meta-data in the Android manifest private to the package?

I want to use meta-data in the Android manifest to customize the behavior of a service.
Alan
  • 12,952
  • 3
  • 18
  • 13
5
votes
1 answer

getPackageManager ().getInstalledPackages (PackageManager.GET_ACTIVITIES) returns null

If I call PackageManager pm = getPackageManager () ; List pis = pm.getInstalledPackages (PackageManager.GET_PROVIDERS) ; I get a list of installed packages, including any provivders they declare (i.e, with pis[i].providers…
5
votes
0 answers

Android App Bundle check for missing splits causes "RuntimeException: Package manager has died"

I followed this guide to integrate a check into my app to prevent crashes at runtime when using Android App Bundles (for missing resources). I added the following code to my application class in the onCreate() method before the super call: if…
5
votes
1 answer

PackageManager throws NameNotFoundException for all apps even for my own app

I'm loading all apps from android and then I display them in my launcher (icon + name). Code looks like following: public class PhoneAppItem { String mPackageName = null; String mActivityName = null; String mName = null; …
prom85
  • 16,896
  • 17
  • 122
  • 242
5
votes
1 answer

PackageManager#installPackage doesn't work for Android N

When using build tools version 24 and Android device with N image (npd56n) I'm unable to install package using PackageManager#installPackage. When URI with the file: scheme is passed to the method, -3 is returned, I assume it is the…
5
votes
2 answers

How to programmatically disable apps without root?

I've just found an app that allows to disable Samsung apps without root, and in the background: https://play.google.com/store/apps/details?id=com.hecorat.packagedisabler And also this free…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
5
votes
1 answer

Android: Get localized permission group names

In marshmallow's runtime permission, user can choose "never ask again" in permission requests. In this case, we have to redirect user to app settings to let them enable the permissions for the app. Also, Android permissions are group based, it will…
5
votes
3 answers

how to load app directly without launching homescreen

When android device power on, is it possible to load one specific application without launching home screen? How to make this change? Where to change code Setting permission as boot_completed works but before my application is loaded, the homescreen…
5
votes
3 answers

When you use Intent.ACTION_DELETE, how can you tell if the user actually uninstalls the app?

This is my code Intent intent = new Intent(Intent.ACTION_DELETE); intent.setData(Uri.parse("package:" + theApp.getAppOpen())); startActivity(intent); When startActivity is called, a default prompt comes up, asking the user whether they want to…
Ryan D'souza
  • 653
  • 11
  • 22
5
votes
1 answer

How to check if install is from Samsung app store

I know how to check: packageManager.getInstallerPackageName(pContext.getPackageName()) I know from other StackOverflow answers and my apps in the wild that: Google Play returns: com.android.vending Amazon returns: com.amazon.venezia If I install…
Stanley
  • 1,421
  • 5
  • 19
  • 36
5
votes
1 answer

Unable to get intent filters from a package

I want to list all the intent filters that are present in an package. I am trying to do it using PackageManager class. I have set the flag PackageManager.GET_INTENT_FILTERS while fetching the PackageInfo object. But I dont know how to use it. I was…
yashdosi
  • 1,186
  • 1
  • 18
  • 40