There is an actual browser function to check if an app is installed. I haven't used it before so I cant give any more details, but I think this will help you:
Is your app installed? getInstalledRelatedApps() will tell you!
Hope this helps!