tags:

views:

90

answers:

2

I want to develop such an app. on installation of which I would have two choices while sending sms either through my app or default sms app.

Is there any way through which we can capture an outgoing SMS?

A: 

You can checkout the src code of android-smspopup.

Macarse
+1  A: 

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.

Frank
I 've added the intent filter in my AndroidManifest.xml. Application gets installed on my Samsung Galaxy. But now still my application doesn't get notified when sms is sent. In short, nothing happens. Do I need to make some changes to make my application as default sms client
success_anil
A dialog should pop up letting you choose between the default SMS app and your app. It may be a change that Samsung made in their Launcher application, perhaps they aren't using any of the stock intents to launch their SMS app. You can take a look at what intent they are using by looking through the debugger logs in DDMS and sending an SMS to someone.
Frank
Thanks Frank. Will the sms app detection will also work on emulator. As of now I 've tested it's not working on both hansets(sony xperia ) and emulator . There's a one app called ChompSmS available in android market (and freely downloadable .apk) has the same functionality we are discussing about. After installing Chomp sms to my emulator , when I tried sending sms through emulator it gave me options to send sms from default sms app or Chomp SMS
success_anil
Thanks Frank .. I 've solved it ... I was putting intent filter tags at wrong location in AndroidManifest.xml.
success_anil
There's one issue my appilication get's pop when user try to send SMS to a contact in contact book from contact application but if he tries to resend sms from SMS application no such pop comes
success_anil