How to use intent-filer and custom URL scheme in Android

1 minute read

Intent Filter is used to specify the type of intents that the component would like to receive. Custom URL schemes provide a way to refer some resources inside your app. Users tapping a custom URL in the social media such facebook, for example, launch your app in a specified context. Other apps can also trigger your app to launch with specific context data; for example, a photo library app might display a specified image.

Create Deep Links to App Content

Allowing Other Apps to Start Your Activity

<activity android:name=".MainActivity">
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />

        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data android:scheme="studio" android:host="exitt" />


How to call custom URL scheme

1. Web to Android (Already installed)

<a href="studio://exitt?shareid=testid&sharedt=20190920"> Test </a>


2. Web to Android (Not installed)

If app is not installed, go to playstore. Otherwise, run your app.

<a href="Intent://exitt?native_pg_id=10&web_pg_id=detail&sns_id=facebook&video_url=$d#Intent;scheme=studio;action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;package=com.invest.stockonair;end"> Test </a>


3. Web to Android (Always go to playstore)


4. Android to Android

String url ="test_app_link://test_detail?test_param=10";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));

How to read data from intent parameters

Intent intent = getIntent();
if (Intent.ACTION_VIEW.equals(intent.getAction())) {
    Uri uri = intent.getData();
    String strid = uri.getQueryParameter("shareid");
    String strdt = uri.getQueryParameter("sharedt");




Leave a comment