Is it possible to to launch an application using a URL launched from within the Android messaging app (SMS or MMS)?
Open Settings . Click Apps. In the list of apps, click Messages. SMS.
The user can tap the messaging icon in your app to send the message. In the messaging app launched by the intent, the user can tap to send the message, or change the message or the phone number before sending the message. After sending the message, the user can navigate back to your app using the Back button.
How can send SMS to multiple numbers in android programmatically? You can't do this via Intent, as the android SMS app doesn't allow multiple recipients. You can try using the SmsManager class. First of all you need to request the permission android.
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>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data
android: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.
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
<activity android:name="com.SomeActivity" adroid:theme="@style/MyTheme"
android:label="@string/app_name">
<!-- For app launcher -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="com.YorAppPackage" />
</intent-filter>
<!-- To open app using link -->
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android: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.
No, the only URL recognized are:
From TextView's android:autoLink XML attribute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With