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
10
votes
3 answers
PackageManager namenotfoundexception
I'm new to android programming. I've created an app using Eclipse with a MainActivity.java and ClassFragment.java files. ClassFragment is a frangment. And I'm using newly updated appcompat library. I just want to implement a toast in my fragment…

user5770725
- 101
- 1
- 3
10
votes
1 answer
Solving "Package manager has died" RuntimeException
I have an Android app that should list all installed apps on a device (no root). I have tried both getInstalledApplications(0) and getInstalledPackages(0) methods of PackageManager, but on some devices, which do apparently have too many apps…

Stan
- 8,683
- 9
- 58
- 102
9
votes
3 answers
Get Preferred/Default app on Android
I am trying to get the default/preferred application for a given Intent. For example, when the user installs a second web browser, then attempts to open a URL, he or she will get a dialog like this:
If the user then selects the Use by default for…

Phil
- 35,852
- 23
- 123
- 164
9
votes
7 answers
Why is no Activity found to handle Intent?
Instead of going the regular getPackageManager().getLaunchIntentForPackage("com.example.app") way, I want to create the launch intent by myself.
Intent intent = new…

Tamás Bolvári
- 2,976
- 6
- 34
- 57
9
votes
2 answers
How to get UserHandle of activity in multi user system
I have a service that runs in the background that monitors the foreground activity. At present this does not distinguish between users (multi user accounts Android 4.2). Is there a way that the service can compare the user it is running under with…

stevev
- 321
- 1
- 5
- 8
8
votes
3 answers
How to find out if a Skype call is currently active on Android
Okay, I decompiled Skype's manifest to find out if there are any Services or Broadcasts running during a call.
There are only a few internal broadcasts for incoming calls. Also only one receiver and one service exist.
I monitored all running…

Force
- 6,312
- 7
- 54
- 85
8
votes
3 answers
How to change theme from another app resource in android?
I know there is a way to set themes by defining in styles.xml and use it like that
setTheme(android.R.style.MyTheme);
However, I want to get themes from another app which I developed as well. I know the resources names and actually I am able to…

Berkay92
- 552
- 6
- 21
8
votes
1 answer
"How are" Android applications (Facebook etc.) installed to an android phone?
I know how to install an application to an Android device e.g from Play-Store or via an .apk file. But I'd like to understand the actual process of installation.
E.g. on Windows:
Serial codes etc. are placed in the registry
Files important to the…
user4920338
8
votes
2 answers
Enable downgrade when installing apk using intent on Android 4.2+
Is possible to enable downgrade when installing apk using intent on Android 4.2+? I found out that it is possible, when installing app via command shell (using -d) adb install -r -d , so I hope it is somehow possible also via Intent. I…

Koso
- 3,200
- 2
- 20
- 22
8
votes
2 answers
Android ClassCastException with blank type
I am getting a strange behavior, and I guess I'm more looking for an explanation than a solution (although solution is welcome as well!).
Here's the code:
PackageManager pm = context.getPackageManager();
List pkgList =…

hiBrianLee
- 1,847
- 16
- 19
7
votes
1 answer
Install APK programmatically on android
I've been trying to get an android application to install an APK on the sdcard programmatically but I'm running into a little trouble.
This is how I'm doing it:
Intent intent = new Intent(Intent.ACTION_VIEW); …

Jose R. Cruz
- 909
- 2
- 9
- 15
7
votes
1 answer
App crashing with 'boolean android.content.Intent.migrateExtraStreamToClipData()' on a null object reference' even when try/catch block is there
I'm trying to open certain apps using there package names and for that I'm using this code:
public void openAppHavingPackageName(String packageName, String appName) {
try {
Intent intent =…

Hammad Nasir
- 2,889
- 7
- 52
- 133
7
votes
1 answer
Delta update for Android App updates
I am trying to setup my own Server to host apk files which will be available for installs and updates in the client App.
On new version update of apk, only the updated part should get downloaded at the client end. I am able to generate a patch file…

Sarala Hegde
- 121
- 1
- 6
7
votes
2 answers
Android Lollipop - PackageInstaller.Session commit()
I'm trying to install packages on my device (from a device-owner app that runs on it) only by using the PackageInstaller and PackageManager APIs. I have been looking for examples but couldn't find anything that fit my need.
Here is a sample of my…

CyrBt
- 83
- 1
- 5
7
votes
1 answer
Android: getting an APKs minSdkVersion from Android code
I'm developing an Android app that has the ability of installing additional apps (which act as plugins for my app) if the user requires it.
However, each of these additional apps may require a specific Android version to run. I would like to perform…

Master_T
- 7,232
- 11
- 72
- 144