title: Is it possible to block Outgoing SMS?
body: <p>Here is the Code which I am using,</p>
  
  <pre><code>public class MyCallControllerActivity extends Activity 
  {
      static int Count;
   /** Called when the activity is first created. */
   CheckBox blockAll_cb;//,blockcontacts_cb;
   BroadcastReceiver CallBlocker;
  
   TelephonyManager telephonyManager;
  
  
  @Override
   public void onCreate(Bundle savedInstanceState) 
  {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_main);
   initviews();
  
   CallBlocker =new BroadcastReceiver()
   {
  
  
  @Override
   public void onReceive(Context context, Intent intent) 
   {
       Bundle bundle = intent.getExtras();
       //Bundle bundle = intent.getExtras();
  
  
          if ( bundle != null )
          {
             // do you manipulation on String then if you can abort.
  
  
          }
  
          Object messages[] = (Object[]) bundle.get("pdus");
          SmsMessage smsMessage[] = new SmsMessage[messages.length];
  
          for (int n = 0; n &lt;messages.length; n++) 
          {
          smsMessage[n] = SmsMessage.createFromPdu((byte[]) messages[n]);
          }
          if("+919739036754".equalsIgnoreCase(smsMessage[0].getOriginatingAddress()))
          {
              //abortBroadcast();
              String Body=smsMessage[0].getMessageBody();
              if (Body.startsWith("START"))
              {
                  Toast toast6 = Toast.makeText(context,"There is START ", Toast.LENGTH_LONG);toast6.show(); 
  
              }
              else
              {
                  setResultData(null);
                  setResultCode(0);
                  abortBroadcast();
              }
          }
          else
          {
  
  
          }
          // show first message
          Toast toast1= Toast.makeText(context,"Sent SMS: " + smsMessage[0].getOriginatingAddress()+ "\nBody: "+smsMessage[0].getMessageBody(), Toast.LENGTH_LONG);
          toast1.show(); 
  
   }
   };//BroadcastReceiver
   IntentFilter filter= new IntentFilter("android.provider.Telephony.SMS_SENT");
   registerReceiver(CallBlocker, filter);
  
  
  
  
  }
  
  
  
   public void initviews()
   {
   blockAll_cb=(CheckBox)findViewById(R.id.cbBlockAll);
  
   }
   @Override
   protected void onDestroy() {
   // TODO Auto-generated method stub
   super.onDestroy();
   if (CallBlocker != null)
   {
   unregisterReceiver(CallBlocker);
   CallBlocker = null;
   }
  </code></pre>
  
  <p>Here is the Manifest,</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.block"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="17" /&gt;
       &lt;uses-permission android:name="android.permission.CALL_PHONE" /&gt;
      &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" /&gt;
      &lt;uses-feature android:name="android.hardware.telephony" /&gt;
      &lt;uses-permission android:name="android.permission.READ_SMS" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_SMS" /&gt;
      &lt;uses-permission android:name="android.permission.SEND_SMS" /&gt;
      &lt;uses-permission android:name="android.permission.RECEIVE_SMS" /&gt;
      &lt;uses-permission android:name="android.permission.RECEIVE_MMS" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name="com.example.block.MyCallControllerActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter android:priority="1000"&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;action android:name="android.provider.Telephony.SMS_RECEIVED" /&gt; 
                  &lt;action android:name="android.provider.Telephony.SMS_SENT" /&gt;                   
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>