Exposing that your app is installed to the android browser
I am trying to find a way to detect in the android browser whether my application has been installed.
Use case: I have a web page that a user can reach via their android web browser. If the application is installed it would show "Tips & tricks". If it is not installed, it would show promotional material and a link to download the app.
Attempted solution: My initial thoughts have been to associate my application with a custom mime type using the apps manifest and in the web page iterate javascript's mimeTypes array. I figured if the mime type showed up in开发者_StackOverflow中文版 the array, I could assume that the application was installed.
Unfortunately, the mimeTypes array doesn't ever change.
Any ideas how I could determine if my application is installed when the user accesses my web page via the android browser?
Thanks for any help / insight you might have.
You can have your local application start a local http server. From your webpage you try to get some predefined resource from this local app. If it is installed it will serve and you know that your app is installed. If not your app is not installed on the host device.
精彩评论