Detect if Android app has been installed on the device using a mobile web page - PHP and JS
Fortunately, this is not possible, for obvious privacy reasons.
The closest that you can do is in the application, have an activity that has an <intent-filter>
for some URL structure, and have a link in the mobile Web site to a matching URL.
If the user clicks the link and the app is installed, the activity will be a chooser option for the user.
If the user clicks the link and the app is not installed, or they choose to stick with their Web browser from the chooser, whatever Web page exists at that URL will be displayed (E.g., instructions of how to download the app).
Detect from browser if a specific application is installed in Android
You mean from JavaScript running in the browser? I think (hope) that's impossible. I wouldn't want any random website to be able to see what apps are installed.
If you want the user to install a particular app, you can provide a Market link on your website: http://developer.android.com/guide/publishing/publishing.html#marketintent
Edit: After your clarification in the comments to my answer, a more useful answer appeared below, which rightfully has more upvotes.
How to detect if the user has the mobile application from a website and open the app
On Android, you can use app links for your domain. On iOS, you have a similar technique, universal links. Set up these in your mobile apps and redirect a user to such deep link to open content inside your app. If the app is installed, it seizes that redirect and can continue to interact with the user. And if not, a web-page hosted on the link is opened.
How can I check if an app is installed from a web-page on an iPhone
As far as I know you can not, from a browser, check if an app is installed or not.
But you can try redirecting the phone to the app, and if nothing happens redirect the phone to a specified page, like this:
setTimeout(function () { window.location = "https://itunes.apple.com/appdir"; }, 25);
window.location = "appname://";
If the second line of code gives a result then the first row is never executed.
Similar questions:
- iPhone browser: Checking if iPhone app is installed from browser
- Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?
Related Topics
PHP How to Retrieve Array Values
Bad Request. Connecting to Sites via Curl on Host and System
Cannot Send Session Cookie - Headers Already Sent
How to Run Multiple Insert Query in SQL Using PHP in One Go
How to Connect SQL Server with PHP Using Xampp
Use Openssl_Encrypt to Replace Mcrypt for 3Des-Ecb Encryption
MySQL - Insert Date Range into Date Columns If Dates Don't Overlap with Existing Ones
How to Add Dynamic Dropdown List Column on Laravel 5.3 Registration
MySQL Select from Tables Based on Multiple Rows
Simplexml: Working with Xml Containing Namespaces
How to Dynamically Populate Options on Dropdown Lists Based on Selection in Another Dropdown
How to Do Multiple SQL Statements in One MySQL_Query
How to Construct a Cross Database Query in PHP
Why Session Object Destruction Failed