tags:

views:

117

answers:

2

Is it possible to to launch an application using a URL launched from within the Android messaging app (SMS or MMS)?

A: 

No, the only URL recognized are:

  • Web URLs.
  • Email addresses.
  • Phone numbers.
  • Map addresses.

From TextView's android:autoLink XML attribute.

Macarse
A: 

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.

Adam