android-package-managers

Launch an activity of an application from a different application on Android

ⅰ亾dé卋堺 提交于 2020-01-03 19:42:14
问题 I need to launch an activity (not the main activity) of an application from an application I have made. The activity I want to launch is proprietary, hence, I cannot make any changes to its code(or manifest). For example: I want to launch somebody's Facebook profile from my own application. A normal intent to facebook from my app would open the 'newsfeed'(which I don't want). I want to know how to access any other activity. Thanks in advance! The little code I have: String PACKAGE="com

Unable to get intent filters from a package

只愿长相守 提交于 2020-01-03 15:30:17
问题 I want to list all the intent filters that are present in an package. I am trying to do it using PackageManager class. I have set the flag PackageManager.GET_INTENT_FILTERS while fetching the PackageInfo object. But I dont know how to use it. I was able to get all the info related to activites and receivers using the respective flags, but dunno how to proceed for intent-filters. Any ideas how to solve this issue? 回答1: Looks like intent filters are not exposed in the API and the flag

Is it possible to replace an existing Android free app with its paid version

旧时模样 提交于 2020-01-03 06:31:28
问题 Hi guys i have made an app free version and paid version. I was wondering that, Is there any way i can replace the free version with the paid version during istallation. * Consider this Scenario * The user has already installed the free version. Now he wants some added functionality which is only available in paid version. So he is redirected from app to google play where he buys and installs the paid version. Now he has the free and paid version but we know that he will now use the paid

How to use PackageManager to retrieve dialer/browser/sms app etc?

北城以北 提交于 2020-01-03 05:08:05
问题 I am writing a launcher and I need to find the dialer, browser, sms and camera app to put as shortcuts on the dock. I assume different vendors like Samsung/HTC/Google will all have different apps for each of these with different package names. Is there a way to use the PackageManager to get the default dialer app for example? EDIT: As per the advice given below I ended up implementing it like this: Intent i = new Intent(Intent.ACTION_CALL); i.setData(Uri.parse("tel:123456789")); ResolveInfo

Is PackageManager.getComponentEnabledSettings() persistent between cold starts?

末鹿安然 提交于 2020-01-01 03:35:27
问题 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 ComponentName(context, MyBroadcastReceiver.class); context.getPackageManager().setComponentEnabledSetting( compName, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); Thanks in advance... 回答1: Is PackageManager

getPackageManager ().getInstalledPackages (PackageManager.GET_ACTIVITIES) returns null

五迷三道 提交于 2019-12-31 17:07:23
问题 If I call PackageManager pm = getPackageManager () ; List<PackageInfo> pis = pm.getInstalledPackages (PackageManager.GET_PROVIDERS) ; I get a list of installed packages, including any provivders they declare (i.e, with pis[i].providers possibly being non-null). However, if I include PackageManager.GET_ACITIVITIES among the flags, as in PackageManager pm = getPackageManager () ; List<PackageInfo> pis = pm.getInstalledPackages (PackageManager.GET_ACTIVITIES | PackageManager.GET_PROVIDERS) ; I

Two Packages in Same APK possible?

狂风中的少年 提交于 2019-12-24 16:53:31
问题 I am trying to implement this great technique of sharing preferences across two different applications while still MODE_PRIVATE. My problem is that the first application cannot assume that the first application is installed (and vice versa) and so: Context c = createPackageContext("com.app.first", MODE_PRIVATE); Must be replaced by: Context c = createPackageContext("com.app.shared", MODE_PRIVATE); But that mandates adding that com.app.shared for real, which translates into a second APK? In

How to create a chooser for a list of applications using package manager

百般思念 提交于 2019-12-24 16:10:41
问题 Basically I have a list of package names for popular email apps, and I want to create a chooser to launch the send email intent, you can refer to this question, here he uses the package manager for just gmail, I want to do it for a list of packages 回答1: What I want to do is simulate the desktop behavior when you click on an email link which opens outlook/gmail client with the to field set to the email id, but in addition to this I want to let the user choose the email application that is

Creating custom chooser for share intent by package name

社会主义新天地 提交于 2019-12-24 15:41:55
问题 I have a Text in my android activity and I want give the user option to share it on social apps like whatsapp, line, facebook, twitter etc. But I want to create a custom chooser so that it won't show unintended apps in the chooser. I'm aware of this snippet Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); shareIntent.setType("text/plain"); startActivity(Intent.createChooser(shareIntent, "Share via")); How can I make it so that in the chooser it'd only show the apps which I

how can i get the package name of 2nd top activity which is in other package?

故事扮演 提交于 2019-12-24 15:28:51
问题 here in my case, a app invokes a service and the service will inturn starts an activity. My problem here is to get the app package which invokes that service. Can anybody help me to solve this ? 回答1: I found this directly from android source and it works fine :) final ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); final List<ActivityManager.RecentTaskInfo> recentTasks = am.getRecentTasks(3, ActivityManager.RECENT_IGNORE_UNAVAILABLE); for (int i = 0, index =