Reputation: 65077
You built a mobile app and your mobile app relies on a 3rd party app.
Is it possible for your mobile app to find out if the required 3rd party app has been installed or not? (If not then prompt the user to install the required app.)
Upvotes: 0
Views: 331
Reputation: 396
Check if a particular pacakage has been installed by using a PackageManager
. You can include the code to fetch the package inside the catch
statement.
private boolean isPackageInstalled(String packageName, PackageManager packageManager) {
try {
packageManager.getPackageInfo(packageName, 0);
return true;
} catch (PackageManager.NameNotFoundException e) {
return false;
}
}
Check the following answer for further explanation
Check if application is installed - Android
Upvotes: 1