Is there any way (intent) to know if my application is installed ? I followed the below link, but my application don't get the intent when my app is installed
-
3so you have app A, and wish to know when app B is installed; or you have app A; and wish to know when upgrade or reinstall is about to happen? – bbaja42 Dec 01 '10 at 11:05
-
I want know in app A, if app A is installed. – Shri Dec 01 '10 at 12:45
-
1So app A is running, and during runtime you want to check to see that the running app is actually installed? – Mike Yockey Dec 01 '10 at 13:00
-
"I think; therefore I am" - Rene Descarte – Chris Stratton Dec 01 '10 at 15:20
-
Actually, the use case is. My App doesn't have icon in app launcher. Basically I want to start the service immediately after the app gets installed (User will not start my app). – Shri Dec 02 '10 at 11:41
-
2Have you found your answer yet? – Sebastian Roth Dec 15 '10 at 05:22
-
refer this link to che app is install or not [link to Check faebook app install or not][1] [1]: http://stackoverflow.com/a/17373280/3392323 – SAndroidD Jul 01 '14 at 11:29
2 Answers
If you want to execute any code from app A, it has to be already installed (it's obvious, isn't it?), so you can't check from your app A whether your app APP is installed or not.
It's like if you want to know when you are dead: after you die, it will be impossible to know it. On the other hand, someone else can know when you die... same for the Android scenario: an app B can know whether app A is installed or not (by using getInstalledPackages
or intents or whatever).

- 5,934
- 1
- 31
- 42

- 198,401
- 62
- 356
- 264
-
Actually, the use case is. My App doesn't have icon in app launcher. Basically I want to start the service immediately after the app gets installed (User will not start my app) – Shri Dec 02 '10 at 11:41
-
Then, you can try to intercept some external intent with a `BroadcastReceiver`. Not sure if you can intercept `android.intent.action.PACKAGE_ADDED`... but I know you can intercept something like the Boot intent (in that case you would have to wait until the user reboot the phone, though). You can search for any other intent that you can use once, just to start the service. – Cristian Dec 02 '10 at 13:14
-
android.intent.action.PACKAGE_ADDED can't be received self , it will notify only in case is any other app installs the app – Shri Dec 02 '10 at 14:28
-
You can use http://developer.android.com/reference/android/content/pm/PackageManager.html#getInstalledPackages(int)
Remember to set the appropriate permission in your AndroidManifest.
You quoted the link to Android - How to intercept the 'Install application' intent - which would mean you like to know when you application was installed at all? Are you trying to check if people actually download your app? Basically I think it's not possible to do that.
But if you like to see if your app was installed, just check for a SharedPreference and if not possible, it's a fresh install.

- 1
- 1

- 11,344
- 14
- 61
- 110
-
I just want to know if my app is installed , I mean fresh install use case is when my app gets installed I want to register to content observer so I want to know how this can be done – Shri Dec 01 '10 at 11:37
-
The fresh install test in this answer seems reasonable. You could also do something on first install and then set a flag somewhere, and not do it again if you see that flag already set. – Chris Stratton Dec 01 '10 at 15:23
-
-
Write a shared preference and read it. If it's not available on your programs start it is fresh. Remember if a user deletes your app and reinstalls it, this counts fresh too. – Sebastian Roth Dec 10 '10 at 18:11