0

I am building a website for my own use and was wondering if it is possible to launch a specific android app by clicking a button on the site when it is opened in browser on my phone.

1 Answers1

0

You can't open any application unless you know the scheme for the application.

To learn more about Deep Links, check this out. https://developer.android.com/training/app-links/deep-linking

This is from Android Documentation.


The way it works is pretty simple. In the Android application you need to apply...

<activity
    android:name="com.example.android.GizmosActivity"
    android:label="@string/title_gizmos" >
    <intent-filter android:label="@string/filter_view_http_gizmos">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
        <data android:scheme="http"
              android:host="www.example.com"
              android:pathPrefix="/gizmos" />
        <!-- note that the leading "/" is required for pathPrefix-->
    </intent-filter>
    <intent-filter android:label="@string/filter_view_example_gizmos">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <!-- Accepts URIs that begin with "example://gizmos” -->
        <data android:scheme="example"
              android:host="gizmos" />
    </intent-filter>
</activity>

For example, the code above will look for the http and also the scheme for example

So links could be http://www.gizmos.com OR example://gizmos. But since you are looking to open any application, this would not be possible unless you know their scheme and path.... which would be pretty unlikely.

letsCode
  • 2,774
  • 1
  • 13
  • 37