I want to develop such an app. on installation of which I would have two choices while sendin开发者_开发问答g sms either through my app or default sms app.
Is there any way through which we can capture an outgoing SMS?
You can add the following intent filter to your Activity's AndroidManifest.xml description that will allow the user to select your application for sending SMS when they click on the Send SMS action in the contacts and sms application:
<intent-filter>
<action android:name="android.intent.action.SENDTO"></action>
<data android:scheme="smsto"></data>
<category android:name="android.intent.category.DEFAULT"></category>
</intent-filter>
This passes a data uri in the format of smsto://target-number , your app needs to take care of the text entry and sending of the SMS using SMSManager.
You can checkout the src code of android-smspopup.
精彩评论