Let's set the scene:
I've got a website that needs to use JavaScript to determine whether my app is already installed on the android device it's currently being used on.
If the app is installed, the page will display a link (with a custom protocol) to launch the app. If not, it should show a link to the android market.
I have control over the links to the app and market. The only thing left to do is figure out how to detect if the app is present on the device using JavaScript code (or maybe try to catch an error related to unsupported protocols as an indication of the app not existing).
When I
- click on a web link with
- my custom app protocol and
- the app isn't installed on the device yet
I notice that the android environment generates an "unsupported protocol" error. However, I can't seem to capture this error in the JavaScript code to redirect the user to the android market.
I believe both direct detection and error detection are relevant methods if they're possible at all.
Any suggestions on how to achieve this?
Thank you for your assistance.