android-package-managers

How to get android:configChanges values from ActivityInfo class

天涯浪子 提交于 2021-02-10 06:19:21
问题 I would like to fetch activities info(Such as configchanges, resizemode, if Picture in Picture is supported) of all the packages present in the device. I am able to fetch the activities info using PackageManager with GET_ACTIVITIES flag. With that I can get configChanges value using ActivityInfo.configChanges . However the value returns a random int if there are multiple config values set in android:configChanges . For ex: if below values are set android:configChanges="uiMode

Starting ANY of the installed apps

时光总嘲笑我的痴心妄想 提交于 2021-01-27 20:43:18
问题 i have and app in which the user can scroll through a list of all installed apps and he can pick any app and starts it. For most Apps this works fine with: startActivity(getPackageManager().getLaunchIntentForPackage(packageName_selectedapp)); where packageName_selectedapp is the string of the selected app from the list. BUT for some apps the function getLaunchIntentForPackage(packageName_selectedapp) returns "null", for instance if it is the dialer or contacts activity. How can i get the

Android: Get localized permission group names

。_饼干妹妹 提交于 2020-08-07 05:12:32
问题 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 be very handy to display names of the permission groups that the app needs before we send the user to the settings. I've seen the strings in android.Manifest such as " android.permission-group.LOCATION ". Is it possible to get the permission group

Android: Get localized permission group names

喜欢而已 提交于 2020-08-07 05:08:33
问题 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 be very handy to display names of the permission groups that the app needs before we send the user to the settings. I've seen the strings in android.Manifest such as " android.permission-group.LOCATION ". Is it possible to get the permission group

How to check if an intent can be handled on API 30+ (Android 10+, R)?

≡放荡痞女 提交于 2020-06-29 03:58:39
问题 Below 30 API there were two methods I could use to check if intent can be handled by some app activity: fun Intent.canBeHandled(packageManager: PackageManager): Boolean { return resolveActivity(packageManager) != null } fun PackageManager.isIntentCanBeHandled(intent: Intent): Boolean { val infos = queryIntentActivities(intent, 0) return infos.isNotEmpty() } But when I test on Pixel 3 API 30 Emulator it doesn't work as expected, e.g. queryIntentActivities() returns usually 0 or 1 (e.g. 1 for

Installation process of .apk within ART. Difference from Dalvik VM installation process

橙三吉。 提交于 2020-02-06 05:51:14
问题 Recently I answered this question, where was described whole installation process of .apk file to android phone. The one thing it was about using Dalvik VM . And now I'm wondered is installation process is exactly same using ART ? What are the differences? I mean the work of PackageManager , path , convertion to dex format etc. Googling didn't give much info, only about performance power, managing memory and something similar. I would be very thankful if someone with knowledge could share

Installation process of .apk within ART. Difference from Dalvik VM installation process

不羁岁月 提交于 2020-02-06 05:51:07
问题 Recently I answered this question, where was described whole installation process of .apk file to android phone. The one thing it was about using Dalvik VM . And now I'm wondered is installation process is exactly same using ART ? What are the differences? I mean the work of PackageManager , path , convertion to dex format etc. Googling didn't give much info, only about performance power, managing memory and something similar. I would be very thankful if someone with knowledge could share

Get active Application name in Android

十年热恋 提交于 2020-01-19 04:58:06
问题 I am trying to make a program that shows all the active applications. I searched everywhere but could only find code that shows the package name only. It would be of great help if you masters can tell me how to display all the active application name 回答1: Did you try using ActivityManager.getRunningAppProcesses() ? Here is the sample code for retrieving names: ActivityManager am = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE); List l = am.getRunningAppProcesses(); Iterator i = l

How to pull List of installed App name, package name and icon drawable

丶灬走出姿态 提交于 2020-01-12 09:45:27
问题 I'm trying to figure out how i can implement this code into my existing source code. Currently i have some source that displays a list-view of all the installed apps and on-click will send intent to the application. I'm needing some support on how to pull the icon and add this into the list view. Any help, source code editing, links, etc would help me resolve this. Thank you ListInstalledActivitiesActivity public class ListInstalledActivitiesActivity extends ListActivity { // Buffer used to

How to get a list of users for the current device, even before Lollipop?

血红的双手。 提交于 2020-01-11 13:52:07
问题 Background Since API 17 (Jelly Bean), it's possible for Android users to have multiple-users using the same device. In the beginning it was only for tablets, but on Lollipop (API 21) it's available for smartphones too. I'm trying to check out which apps the current user have that are shared amongst other users of the current device, so that I could know if the user should be notified that uninstallation can be done for all users (written about here). That's because I've made an app that can