android-package-managers

How to find installed applications in Android?

限于喜欢 提交于 2019-12-01 09:21:45
I want to get the name and package name of a third party application installed in Android. I have tried but I got the name of all applications (third party and pre installed). How can I identify whether an application is a system application or an other application? Nitin This will do the trick...cheers :) PackageManager pm = getPackageManager(); List<PackageInfo> list = pm.getInstalledPackages(0); for (PackageInfo pi : list) { ApplicationInfo ai; try { ai = pm.getApplicationInfo(pi.packageName, 0); System.out.println(">>>>>>packages is<<<<<<<<" + ai.publicSourceDir); // this condition if

How to find installed applications in Android?

与世无争的帅哥 提交于 2019-12-01 06:16:33
问题 I want to get the name and package name of a third party application installed in Android. I have tried but I got the name of all applications (third party and pre installed). How can I identify whether an application is a system application or an other application? 回答1: This will do the trick...cheers :) PackageManager pm = getPackageManager(); List<PackageInfo> list = pm.getInstalledPackages(0); for (PackageInfo pi : list) { ApplicationInfo ai; try { ai = pm.getApplicationInfo(pi

Android PackageStats gives always zero

此生再无相见时 提交于 2019-11-30 16:06:57
I'm trying to get the size occupied by my application package. Every application has one location in the internal/external storage. I want to calculate the size of the following directory, how can I do that? I know I can use StorageStateManager on and above Oreo (API 26) devices, but how can I achieve this before oreo devices. Application Directory : /Android/data/myapplicationpackage I'm trying to use PackageStats but It's giving me always zero. What's the actual way to use this code? I used the following code and it gives me all zero. PackageStats stats = new PackageStats(context

“How are” Android applications (Facebook etc.) installed to an android phone? [closed]

旧街凉风 提交于 2019-11-30 12:18:26
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . 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 running of software are placed

How to Enable Android Download Manager

拟墨画扇 提交于 2019-11-30 10:28:26
问题 I'm using Android Download Manager to download list of files. Lately I came across a crash report saying Unknown java.lang.IllegalArgumentException: Unknown URL content://downloads/my_downloads Then later, I figured it out that the reason is because user disabled Android Download Manager. I check if the Download Manager is disabled by checking it's package name with the code below. int state = this.getPackageManager().getApplicationEnabledSetting("com.android.providers.downloads"); And now, I

part-2 persistent foreGround android service that starts by UI, works at sleep mode too, also starts at phone restart

荒凉一梦 提交于 2019-11-30 10:10:17
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 mention in Part-1, but for some reason I can persistently cannot make a design and correct strategy with code that has true integration and sanity. It was a lengthy question and the question nor answer could have been concluded or finalized in just one episode, so I have made this second part as a synopsis. May be I am incompetent or just disturbed

Get minSdkVersion and targetSdkVersion from apk file

与世无争的帅哥 提交于 2019-11-30 08:54:12
I am trying to get the values of minSdkVersion and targetSdkVersion from an apk stored on the device. Getting other details are discussed here , but only the targetSdkVersion is available in the ApplicationInfo class. Can the minSdkVersion be obtained other than by extracting the apk file and reading AndroidManifest.xml? JohanShogun I do not believe this is possible to do on your own and there is no pre-made api for this. The current methods that read and parse the AndroidManifest do not consider minSdkVersion at all. In order to check your apk file without using the ready made functions you

“How are” Android applications (Facebook etc.) installed to an android phone? [closed]

时光总嘲笑我的痴心妄想 提交于 2019-11-30 02:28:35
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 running of software are placed within the Program Files folder ( the main .exe etc. ) So far, what I do know about the Android application installation process is: After an android application has been executed (post-installation), data freshly downloaded is placed in locations like: Android/data or Android/obb etc. If specifically expressed by an

How to update Gradle dependencies to their latest version

假装没事ソ 提交于 2019-11-30 00:06:54
Is there an easy way to get gradle to update dependencies to their latest available version? For build reproducibility all my dependencies are defined with a version number like this in my build.gradle file: dependencies { compile 'namespace:package1:version' compile 'namespace:package2:version' compile 'namespace:package3:version' } Periodically I want to update every package to their latest version. Typically this is the first thing I do for a new sprint after making a release. It's a real pain doing this manually for each package. Ideally I would like a command to update the build.gradle

Android PackageStats gives always zero

耗尽温柔 提交于 2019-11-29 22:17:45
问题 I'm trying to get the size occupied by my application package. Every application has one location in the internal/external storage. I want to calculate the size of the following directory, how can I do that? I know I can use StorageStateManager on and above Oreo (API 26) devices, but how can I achieve this before oreo devices. Application Directory : /Android/data/myapplicationpackage I'm trying to use PackageStats but It's giving me always zero. What's the actual way to use this code? I used