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
3
votes
2 answers
Package Manager has died, DeadObjectException
We use our app on only one device type and we get this error pretty often on it.
The only instance for PackageManager is a BootupReceiver:
public class RestartHelper extends BroadcastReceiver
{
@Override
public void onReceive(Context…

Fabian
- 167
- 1
- 9
3
votes
0 answers
Mismatch between BuildConfig.VERSION_CODE and PackageManager.getPackageInfo() after application update
I discovered a strange situation appears to happened a lot to the my application users (via Crashlytics/Google Analytics reporting..) which I did not able to reproduce:
after my package been updated - the version code returned by the PackageManager…

Tal Kanel
- 10,475
- 10
- 60
- 98
3
votes
2 answers
Package Installer crashes in Android M after requesting permission READ_SMS
I have a Login Fragment that tries to access (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE); this works well with devices up to Lollipop 5.1. And when I tried it in Marshmallow 6.01 it showed security exception. So I…

Sudheer K
- 1,244
- 2
- 18
- 31
3
votes
2 answers
How to restart self package after update
I'm writing the MDM app, that can update itself via PM (pm install -r my.apk).
A several services in my app should be started after update. Can I do this? Devices are rooted.

artem
- 16,382
- 34
- 113
- 189
3
votes
1 answer
How to get the host app's package name from my custom keyboard?
Inside a custom Android keyboard app, is there any way of getting the name of the package that the keyboard is currently running in (i.e the name of the app with the edit field)?

adgad
- 206
- 1
- 2
3
votes
3 answers
How do I create an intent to launch any e-mail app?
I have found various topics here and elsewhere on creating an intent for sending e-mail and that seems to be pretty straightforward. I'm looking for an intent to just launch any e-mail client the user might have.
Here is the code I've seen for…

afonseca
- 817
- 2
- 7
- 10
3
votes
0 answers
How to get 'correct' default launcher programmatically? Shortcuts lose their title
What have I done so far:
I am currenctly facing some problems with the launchers.
My application adds shortcuts to the workspace of the launcher (homescreen).
But on some devices (Samsum Duos) for example, the titles and /or icons
are changed back…

JacksOnF1re
- 3,336
- 24
- 55
3
votes
1 answer
ResolveInfo getIconResource() giving really strange results (incorrect icons)
I'm creating a list of applications installed on the phone. I'm retrieving all installed application with the PackageManagerand ResolveInfo. Due to memory issue i'm using getIconResource() instead of loadIcon().
My question is how do i display the…

DevelopingBeaver
- 155
- 13
3
votes
1 answer
Getting a class bytcode on android
I want to send on the wire a class file (.class) for execution on a remote server. I can not use serialization, because the class does not exist on server side, and I want to add new classes dynamically. I don't want to use RMI.
On Dekstop Java,…

Nico
- 41
- 2
3
votes
1 answer
Resolve all Services matching an intent filter
I want to retrieve all services matching a specific intent-filter. I have the following code :
AndroidManifest.xml of a TestService :

devashish jasani
- 413
- 1
- 4
- 15
3
votes
3 answers
Error in Manifest.xml when adding PACKAGE_USAGE_STATS [Android Lollipop]
I am trying to use "android.permission.PACKAGE_USAGE_STATS" in my app. Here it says that NOTE: This API requires the permission android.permission.PACKAGE_USAGE_STATS, which is a system-level permission and will not be granted to third-party apps.…

user1406716
- 9,565
- 22
- 96
- 151
3
votes
1 answer
Android - PackageManager flags
I am going through the PackageManager API. I find the following constants defined :
1) GET_DISABLED_COMPONENTS
2) GET_DISABLED_UNTIL_USED_COMPONENTS
3) COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED
4) COMPONENT_ENABLED_STATE_DISABLED_USER
5)…

Jake
- 16,329
- 50
- 126
- 202
3
votes
1 answer
Using ApplicationInfo.FLAG_SYSTEM to filter out System Apps
I am using following code to differentiate between User Installed App and System App:
final PackageManager pm = getPackageManager();
List packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo…

Faheem
- 509
- 2
- 7
- 23
3
votes
1 answer
Android INSTALL_PACKAGES Permission and Non-PlayStore Apps
I'm preparing my app for the play store and plan to deliver one component as separate install package (since my customer can't recover the source code, but the app is signed with his key). I thought about two ways of doing that. My needs are just…

Anticro
- 685
- 4
- 12
3
votes
3 answers
ApplicationInfo Vs PackageInfo vs ResolveInfo
For all the installed apps on a phone, I need to access the:
name
icon
google play url from where the app can be installed
I've looked at ApplicationInfo but that doesn't seem to provide this information to me. I've heard of PackageInfo and…

brainydexter
- 19,826
- 28
- 77
- 115