Deep Linking not working - android

activity
android:name=".activity.rechargetab.RechargeActivity">
<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="mobileleb"
android:host="recharge/checkout/status" />
</intent-filter>
</activity>
When I try mobileleb://recharge/checkout/status from the browser it searches google.Its not working. It does not start RechargeActivity.

add android:autoVerify="true" to intent-filter and specify scheme="http" or "https" or both
<activity
android:name=".activity.rechargetab.RechargeActivity">
<intent-filter android:autoVerify="true">
<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="mobileleb" />
<data android:pathPattern ="/recharge/checkout/status" />
</intent-filter>
</activity>

Related

How to show my app as a downloader

How can i register my app as a downloader as shown in the screenshot below. I have tried adding below code in my manifest but didn't work.
<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" />
<data android:scheme="https" />
</intent-filter>
here is my activity in manifest:
<activity
android:name=".modules.downloader.home.HomeActivity"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
You need to provide MIME type as well. If you support all types of files, then you can give <data android:mimeType="*/*" />
<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:mimeType="*/*" android:scheme="http" />
<data android:mimeType="*/*" android:scheme="https" />
</intent-filter>

How to open specific activity on clicking on link?

I am working on an android app in that i have added sharing whatsapp sharing feature,I have done it successfully,Now i want to open a specific activity of my android application when user click on link i have shared.I have searched few links but no luck,I hope somebuddy will help me in this.
Added manifest
<activity
android:name=".ProductDescriptionActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="com.abc.allaboutcity.MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter android:autoVerify="true">
<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="http://allaboutcity.in"
android:pathPrefix="/allaboutcity" />
</intent-filter>
<intent-filter >
<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="allaboutcity"
android:host="allaboutcity" />
</intent-filter>
</activity>
You should add intent filter in your manifest file to activity that you want to open
<activity
android:name="Your Activity"
android:label="Your Activity Title"
android:theme="Your Style">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="your url"
android:path="/your path"
android:scheme="http" />
</intent-filter>
</activity>
use this code In Your WebView Activity
Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();
Webview webView = (WebView) findViewById(R.id.webview_id);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(""+ data);
next, use this code in AndroidManifest.xml, its for all link (Https / Http):
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"/>
<data android:scheme="http"
android:host="http://allaboutcity.in"
android:pathPrefix="/allaboutcity" />
<data android:host="www.host.com" android:pathPattern="/movie/0.*/" android:scheme="http"/>
</intent-filter>

Control multiple activity intents in android

I am trying to open my app depending on the url that is entered but in some cases it tries to execute several activities at the same time, is there any way to restrict this so that the MainAction does not execute when trying to execute another?, basically my manifest goes like this
Main Activity
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<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" />
<data android:scheme="https" />
<data android:host="www.test.com" />
<data android:host="m.test.com" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="home"
android:scheme="testapp" />
</intent-filter>
</activity>
Detail Activity
<activity
android:name=".DetailActivity"
android:label="#string/title_activity_detail"
android:launchMode="singleInstance"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="detail"
android:scheme="testapp" />
</intent-filter>
<intent-filter android:autoVerify="true">
<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" />
<data android:scheme="https" />
<data android:host="www.test.com" />
<data android:host="m.test.com" />
<data android:pathPrefix="/homes"/>
</intent-filter>
</activity>
the problem is that when i try to open a link like "http://www.test.com/homes" this happens:
Your DetailActivity should be declared as shown below, no intent filter is needed.
<activity
android:name=".DetailActivity"
android:label="#string/title_activity_detail"
android:theme="#style/AppTheme.NoActionBar">
</activity>
The thing that matters is the launchMode for the MainActivity
You should read that : https://developer.android.com/guide/topics/manifest/activity-element.html#lmode

How to register app to share all types of files?

I am trying to use intent filters to do this. I tried this Intent filter for files only but it didn't work. I want to make my app appear in the share menu for all types of files.
Here my intent filter
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="content" />
<data android:mimeType="*/*" />
<data android:host="*" />
</intent-filter>
Try this. It's working in my project
<intent-filter>
<!---->
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>

Applinks intents not working on android

I have an Android app that should open links on the app which clicks from the web browser.
I have the following intent filters:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.VIEW" />
<data android:scheme="http" android:host="www.mysite.com" />
<data android:scheme="https" android:host="www.mysite.com" />
</intent-filter>
And also i checked the my signed sha256 key, package name etc from the assetjson file which is in the mysite/.well-known/assetlinks.json. Everythings looks correct. But the app still not opening when i click the links from the website.
<activity android:name=".YourActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:scheme="http" />
<data android:host="mysite.com" />
</intent-filter>
</activity>

Categories

Resources