1

I am trying to making a demo of deep linking concept in android.

Requirement

  • I want to open my app while user click on one specific link. If my application is not installed in device than user automatically redirect me on play store.
  • I also want to make this link dynamically. I want pass any data through link like below.

"myscheme://example.com/?faqid=95" faqid will be decided at dynamically.

Code Discription

I have take one activity call MainActivity and modify Manifiest like below.

    <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
        <intent-filter>
            <data android:host="example.com" android:scheme="myscheme"/>
            <data android:host="www.example.com" android:scheme="myscheme"/>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>

</application>

Than after I have make one html file which is contain one link. while user press this link than my app will launch. I have doing following code in my html file.

<html>
<body>

<a href="myscheme://example.com/">This is a link</a>

</body>
</html>

But while user click one this link than my app not launch.I don't know where I'm getting wrong.

halfer
  • 19,824
  • 17
  • 99
  • 186
Chirag Solanki
  • 1,107
  • 2
  • 13
  • 23

1 Answers1

0

You can check for installation using this method: Check if application is installed - Android

To link into your app directly look here: https://developer.android.com/training/app-links/

To forward to play store look here: "Rate This App"-link in Google Play store app on the phone

Cory Roy
  • 5,379
  • 2
  • 28
  • 47