It is very simple to open android application by android browser i.e. web deep linking .
Step 1:- Add intent-filter in your activity which need to open by web browser it is either main activity or other activity .
e.g.
<activity
android:name=".YourActivity"
android:label="@string/title_activity_your_deep_linking">
<intent-filter>
<data android:scheme="yourScheme" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
Step 2:- Create request link which will be executed by mobile browsers .
<html>
<body>
<a href="yourScheme:?key1=4444&key2=E110123&type=wabpage&status=1&extra=value">click to open App</a>
</body>
</html
Note :yourScheme is app scheme followed by query string .
Step 3:- Get data in YourActivity class by following android APIs .
Uri uri = getIntent().getData();
String key1= uri.getQueryParameter("key1").toString();
String key2= uri.getQueryParameter("key2").toString();
...
...
...
Enjoy android interesting feature which will help you for referring for android application by browsers .
Step 1:- Add intent-filter in your activity which need to open by web browser it is either main activity or other activity .
e.g.
<activity
android:name=".YourActivity"
android:label="@string/title_activity_your_deep_linking">
<intent-filter>
<data android:scheme="yourScheme" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
Step 2:- Create request link which will be executed by mobile browsers .
<html>
<body>
<a href="yourScheme:?key1=4444&key2=E110123&type=wabpage&status=1&extra=value">click to open App</a>
</body>
</html
Note :yourScheme is app scheme followed by query string .
Step 3:- Get data in YourActivity class by following android APIs .
Uri uri = getIntent().getData();
String key1= uri.getQueryParameter("key1").toString();
String key2= uri.getQueryParameter("key2").toString();
...
...
...
Enjoy android interesting feature which will help you for referring for android application by browsers .
No comments:
Post a Comment