How to launch the app from SMS content (link) - android

i need to launch my app when click on link that is received by sms or email.I mean, the person who receives the SMS simply taps on the link provided, and that launches the application.

Which ever Activity you want to open, when Link is clicked
Need to be use IntentFilter in Menifest like this
<activity
android:name=".interacting.InteractWithApps"
android:parentActivityName=".index.IndexActivity">
<intent-filter>
<data
android:host="www.domain.com"
android:scheme="http" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
You also need to define link schema and host
You should follow as per this link

Related

prevent the app to be displayed in ( open as dialog ) for specific keywords in url using manifest intent filter

Right now in my manifest code I have
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter
android:autoVerify="true"
android:label="#string/app_name" >
<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:name="default-url"
android:host="#string/bc"
android:scheme="#string/bc" />
</intent-filter>
which allow the user to get open with dialog if he click on URL that start with domain of my application for example: pop-up dialog to select the app
and its working fine, however, I'm facing an issue when the user request forgets password he receives a link on his email to reset his password.
the link he received is like this: www.domain.com/forget_password/email.
what I want is to keep the app link working but if the domain contains /forget_password open the browser by default, not the application.
Sorry, there is no "exclude" logic in <intent-filter>. You cannot create an <intent-filter> that says "I accept everything except this".
You will need to handle the forget_password path in your app, perhaps by launching a Web browser yourself.

I want my app to be in the "open with" browser section

If someone clicks on a link it says 'open with' and you can choose between 'Firefox,Chrome...'
How I can put my app there and if someone clicks on my app name ... my app gets started with a parameter which contains this link.
I'm sorry if this is the wrong section.
use <intent-filter>
DESCRIPTION:
Specifies the types of intents that an activity, service, or broadcast receiver can respond to. An intent filter declares the capabilities of its parent component — what an activity or service can do and what types of broadcasts a receiver can handle. It opens the component to receiving intents of the advertised type, while filtering out those that are not meaningful for the component.
Most of the contents of the filter are described by its <action>, <category>, and <data> sub elements.
Here is an example
click me!
AndroidManifest.xml looks like this:
<activity
android:name=".DashBoard"
android:label="#string/title_activity_dash_board"
android:exported="true"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<data
android:host="www.bbc.in"
android:pathPrefix="/"
android:scheme="https" />
<data
android:host="www.stg.bbc.in"
android:pathPrefix="/"
android:scheme="http" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
Note: Order of the intent flags might cause a problem so use like above
"I suggest you simply make another <intent-filter> with the new sub elements in that tag to avoid the problems" look here
You need to add the following <intent-filter> to the Activity (which will open in your app) definition in the manifest file.
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
The <category android:name="android.intent.category.DEFAULT" /> is optional and is only used to consume default intents.

Issue in broadcast intent browser to android native application in GMail body button

Hello friends i have one GMail which include inside one button like "Confirm e-mail" as below
When i click on Confirm e-mail button it is gone to register page inmy website browser. But at that time i wnat to developed flow like if my application is installed in my phone than it should be show popup like wheather this page open in form browser or in my application like below image
See above image it is demo for Linkedin application , same way i want to implement in my application it should be comes my application name when i click on conform e-ail button in Gmail body part
I also make change in my menifest code as like vbelow
<activity
android:name="pkg.android.rootways.worldofrental.Registration"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|stateVisible" >
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
But it is not working so any one have idea how can i make it possible in my application ?
EDIT
<activity android:name=".Registration"
android:exported="false" >
<intent-filter>
<data
android:scheme="http"
android:host="www.secure.worldofrental.com"
android:pathPrefix="WOR" >
</data>
<category android:name="android.intent.category.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.VIEW" />
</intent-filter>
Could you please try adding android:exported="false" for your activity in the manifest
Below is code which is work for me. Hope it helps to you.
Pass the tag in intent-filter in your main activity to open application when the URL is called.
<activity android:name=".MyMainActivity"
android:exported="false" >
<intent-filter>
<data
android:scheme="http"
android:host="www.your website name.com"
android:pathPrefix="/your application name" >
</data>
<category android:name="android.intent.category.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
If user navigate to "www.your website name.com/your application name" and application is installed in youe mobile, then intent will be create and activity will be called. You can also redirect play store if application is not installed in your mobile.

How to call an app mobile via web view?

is there a solution to call a mobile app via a link in a web page(my web page is a web view in a mobile app). For example, I want to call facebook app when tap on a link.
You need to create an <intent-filter>. See Launch custom android application from android browser.
For the simplest case, you need to add something like this to your AndroidManifest.xml:
<intent-filter>
<data android:scheme="http" android:host="your-url-.com"/>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
You have to add an Intent filter in Manifest file like this -
<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:host="www.tamrakar.in"
android:path="/test"
android:scheme="http" />
</intent-filter>
Hope this helps.

Android, How to add my application to appear when user clicks on an e-mail address

Using Android, when I click on an e-mail address in my default browser, a menu list pops up with Gmail, (an built-in email client), and K-9 (another e-mail application).
I would like to add my android application to appear in this list. Is this possible and how do I do this?
add this intent-filter to your activity in manifiest:
<intent-filter>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="mailto" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<data android:mimeType="*/*" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="mailto" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
You need to create an IntentFilter this requires both Java code, where you create an Activity that is triggered when the system notifies someone is trying to send an email, and changes to your AndroidManifest where you subscribe to the Intent action. Here is an SO Post that explains which intent filters you need: android intent-filter to listen for sent email addresses?
You add these to your Activity entry in your AndroidManifest and then when someone clicks an email it'll show your app. when someone clicks it, it'll open that specific Activity you are going to want to read about pulling data out of intents. Specifically you'll want to pull out: http://developer.android.com/reference/android/content/Intent.html#EXTRA_EMAIL from the extras.
Read about intent-filter here:
https://developer.android.com/training/sharing/receive.html

Categories

Resources