0

I need a BroadCast receiver or something like that that I can use when the user WANTS to install an application. That would mean, when the user presses Install - is there something that is broadcasted so that I can catch in my app and forbid the try to install that app?

And if not - is there a mechanism to do this as workaround? I.e. when the application is installed - to be silently uninstalled? I need to have control on which app the user wants to install.

Thanks

Mike
  • 3
  • 2
  • I don't believe such a mechanism exists, and I'm certain that if it did exist it would require system permission, meaning it would have to be signed using the platform-specific signing key. If you're able to sign with that key, you're probably able to add this feature to your own build. – mah Aug 24 '11 at 10:09

2 Answers2

1

That would mean, when the user presses Install - is there something that is broadcasted so that I can catch in my app and forbid the try to install that app?

Fortunately, no.

And if not - is there a mechanism to do this as workaround? I.e. when the application is installed - to be silently uninstalled?

Fortunately, no.

I need to have control on which app the user wants to install.

Fortunately for Android users, you don't have that right.

You are welcome to write your own firmware, put it on your own phones, and distribute those phones.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

There are a intent to catch the install and unistall

<receiver android:name=".IntentReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" />
</intent-filter>
</receiver>

The question was answered here Android - How to intercept the 'Install application' intent

Community
  • 1
  • 1
Aracem
  • 7,227
  • 4
  • 35
  • 72
  • This doesn't answer the poster's question -- he's asking how to be told in advance (possibly with an opportunity to veto the action). You're telling him how to be told after the fact. – mah Aug 24 '11 at 10:07
  • How answered in the link i put, there arent a intent that advise you before the instalation is completed – Aracem Aug 24 '11 at 10:10
  • And which part answers the "and forbid the try to install that app?" question? – Mike Aug 24 '11 at 10:11
  • I think "perhaps" you can analize logcat and see what intent launch the installation process (After push install button) and then try to cathc it – Aracem Aug 24 '11 at 10:12
  • and again, how to forbid its installation / stop the installation process? – Mike Aug 24 '11 at 10:57
  • You're right, the link you provided is to the same basic question -- and on that same link, it's stated that this is not intercepting (i.e., before the install), but rather its detecting (after the install). – mah Aug 24 '11 at 11:33
  • 1
    There arent a mechanism to do that fortunately for the users – Aracem Aug 24 '11 at 11:36
  • 1
    This answer answers the fraction of the question that is possible. It's a useful contrast to CommonsWare pointing out that the overall goal is not. – Chris Stratton Aug 24 '11 at 14:18