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
7
votes
1 answer

Get All Activities by using package Name

I want to get all activities present in Application as a list by using PackageInfo. Please tell me is there any way to do this. Thanks in advance.
Santhi Bharath
  • 2,818
  • 3
  • 28
  • 42
7
votes
0 answers

How to visible/invisible launcher icon in android?

I am creating an application in which i need to hide icon launcher and show icon launcher on request. I used below code to hide launcher icon. // Remove this line from…
7
votes
3 answers

Get Recent and Running application list not processes

I tried a lot to get the list of recent and running applications(not processes) but couldn't get it. I went through all the stackoverflow questions regarding this but the only answer i got about the running processes and recent tasks not the…
Piyush Agarwal
  • 25,608
  • 8
  • 98
  • 111
6
votes
0 answers

What is the right way to install APK for each Android version?

I'm making an APK Install app and I've been through a lot. Especially, versioning. to do that, i looked up some posting and StackOverFlow. but All the postings make me more confused now. So, What is the right way? first of all, please check my code…
6
votes
1 answer

Detecting if application is installed from Huawei AppGallery

I would like to detect the app installation source. We can use two approaches on Android to detect the installation source: PackageManager#getInstallerPackageName(String) or PackageManager#getInstallSourceInfo(String). Both of those calls will…
6
votes
3 answers

getlaunchintentforpackage returning null

Can someone tell me please why this gives me null on the variable intent? public class MainActivity extends AppCompatActivity { private static String action = "com.google.android.youtube"; @Override protected void onCreate(Bundle…
6
votes
2 answers

PackageManager died - DeadObjectException - Transaction failed on small parcel

I've a very simply function like following: public static boolean isAppInstalled(String packageName) { PackageManager pm = MainApp.get().getPackageManager(); try { pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES); …
prom85
  • 16,896
  • 17
  • 122
  • 242
6
votes
2 answers

Android - Install APK silently with PackageInstaller and PackageInstaller.Session

Looking into the sources of Android (AOSP), the installPackage is labled deprecated and inspecting the PackageManager application of Android, it uses the PackageInstaller class to create a PackageInstaller.Session instance to perform the…
6
votes
1 answer

How to detect if device has 3.5 mm audio jack?

I've gone through many posts and forum articles but didn't find anything related to my requirement. Lots of new android devices are coming with no headphone jack built in and I don't need to deal with those devices. Through PackageManger I could…
Shree Krishna
  • 8,474
  • 6
  • 40
  • 68
6
votes
1 answer

Query Intent Activities for Different Profiles : Android for Work

For some technical reasons, I cannot use Android File Picker to get a file and their content into my application. That's why I came up with a solution which queries intents and processes the results on my own UI. Here is how I get the list of…
6
votes
3 answers

Get list of applications which can share data

This code shows default share dialog Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/html"); sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT,…
6
votes
2 answers

How to get the package name of the app which access content provider of my app?

Actually i want some kind of Broadcast when any other app fetches the data from the content provider shared by my app
6
votes
0 answers

App update losing all data as Code/Resouce path for pkg changes

We recently submitted an update of our to Google Play, and have had a handful of users report an issue with all of their data disappearing. We've managed to reproduce the issue once, and it was caused by: 5787 08-17 12:50:56.309 937 1030 W…
Andy Nugent
  • 859
  • 7
  • 21
6
votes
4 answers

Override applicatoinID inside library project's manifest with Gradle

I have a main project which references a library project. They both are compiled with Gradle. This is the defaultConfig for the main project gradle file: defaultConfig { applicationId "com.example.app" minSdkVersion 15 targetSdkVersion…
6
votes
1 answer

Is PackageManager.getComponentEnabledSettings() persistent between cold starts?

If I use the code below to disable a static BroadcastReceiver defined in AndroidManifest.xml, will it be re-enabled after a reboot? It doesn't appear to be but the docs don't say whether it should. final ComponentName compName = new…
Barry Fruitman
  • 12,316
  • 13
  • 72
  • 135