Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening Android app by way of link

Tags:

android

I'm trying to create a link that can be sent via email which when opened my app on an android device. And if the app isn't on the device, it will go to the Google store and search for the app

like image 287
Wiebe Elsinga Avatar asked Jan 21 '26 07:01

Wiebe Elsinga


1 Answers

You can do this:

Create a filter in your Manifest to handle certain URLS, for example:

<intent-filter>
  <action android:name="android.intent.action.VIEW"/>
  <category android:name="android.intent.category.DEFAULT"/>
  <category android:name="android.intent.category.BROWSABLE"/>
  <data android:scheme="http" android:host="your-domain.com" android:path="/your-app"/>
</intent-filter>

So if user has your app installed and opens http://your-domain.com/your-app, your app will be opened and be able to handle it.

Then, make http://your-domain.com/your-app redirect to Google Play (https://play.google.com/store/apps/details?id=com.your.app) if opened directly without your app.

like image 176
Jorge Cevallos Avatar answered Jan 23 '26 21:01

Jorge Cevallos