In Xamarin Android, I use implicit intents to load another app. This can be the browser or whatever. If I want to load i.e. a Facebook link, the OS allows me to choose to use a browser or specifically the Facebook App. This is also the case for a few other links where the page owners have produced an app.
Is there a way to find out if a specific app, say the Stack Overflow app, is installed on the current mobile device?
Yep, here's a Xamarin/C# function that will tell you if a specific app (via its package name) is installed:
public bool IsAppInstalled(string packageName) {
try {
PackageManager.GetPackageInfo(packageName, PackageInfoFlags.Activities);
return true;
}
catch (PackageManager.NameNotFoundException ex) {
return false;
}
}
Example call:
bool bIsAppInstalled = IsAppInstalled("com.theirdomain.someapp");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With