-2

I am new in android so facing some problems. At the time of installation I want to check that an app is installed or not. And how can I show the message that "Please install the required app".

Thanks in advance

MHSN
  • 29
  • 8
  • You can get these kinds of informations from the PackageManager. – Thorben Dec 17 '14 at 13:53
  • possible duplicate of [Android check for dependent application during installation?](http://stackoverflow.com/questions/2518818/android-check-for-dependent-application-during-installation) – rrirower Dec 17 '14 at 13:53
  • possible duplicate of [How to check if the application is installed or not in android programmatically](http://stackoverflow.com/questions/11392183/how-to-check-if-the-application-is-installed-or-not-in-android-programmatically) – Alberto Malagoli Dec 17 '14 at 13:59
  • @Thorben thanks for suggestion .. but Packagemanager will not work at the time of installation, it will work at the time of starting the app. But I want to check at the time of installation. Is there any way to do this???? – MHSN Dec 17 '14 at 14:04
  • No, the first point in time when you can do something is when the user is actively starting your app. – Thorben Dec 17 '14 at 14:06

1 Answers1

2

There is no way for your code to run at the time of installation because, by definition, your code is not yet on the device. And there is no way at the present time to specify some sort of dependency on another app that the Play Store (or any other distribution channel AFAIK) will honor.

Once the code is on the device, and the user runs your launcher activity, you can see if the other app is installed and, if not, prompt the user to install it.

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