Launch Android App From Within Sms/mms Message?
Solution 1:
The previous answer was not correct.
You can add an intent filter for an activity that will "register" your app to handle hyperlinks within the SMS body.
For instance, if you add the following intent to your application.xml:
<intent-filter><actionandroid:name="android.intent.action.VIEW"></action><categoryandroid:name="android.intent.category.DEFAULT"></category><categoryandroid:name="android.intent.category.BROWSABLE"></category><dataandroid:scheme="http"android:host="test.com"android:pathPrefix="/myapp"></data></intent-filter>
And you send an SMS message with the following in the body:
http://test.com/myapp/somedata
Your application will launch and the activity will be able to access the URL as part of the intent data.
Solution 2:
In addition answer given by @Adam,
There is multiple intent filter possible in case of android app, We have to use two. One for the app launcher and one for the launching app using the URL in sms
<activityandroid:name="com.SomeActivity"adroid:theme="@style/MyTheme"android:label="@string/app_name"><!-- For app launcher --><intent-filter><actionandroid:name="android.intent.action.MAIN" /><categoryandroid:name="android.intent.category.LAUNCHER" /><categoryandroid:name="com.YorAppPackage" /></intent-filter><!-- To open app using link --><intent-filter><actionandroid:name="android.intent.action.VIEW"></action><categoryandroid:name="android.intent.category.DEFAULT"></category><categoryandroid:name="android.intent.category.BROWSABLE"></category><dataandroid:scheme="http"android:host="yourdomain.com"android:pathPrefix="/someurlparam"></data></intent-filter></activity>
Now add a URL in your sms something like
http://yourdomain.com/someurlparam
This should launch the app on url click and will add a app icon in android as well.
Solution 3:
No, the only URL recognized are:
- Web URLs.
- Email addresses.
- Phone numbers.
- Map addresses.
From TextView's android:autoLink XML attribute.
Post a Comment for "Launch Android App From Within Sms/mms Message?"