Hello
First of all you must add this code to manifest.xml between application tag
<receiver android:name=".MySMSReceiver" >
<intent-filter android:priority="1000">
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
set priority is important becuse it means your application get incoming sms before everything.
after that you should add necessary permisstion for allow you to read and write sms.
then you have to create class that extends BroadcastReceiver and afterward in onReceive method write this code :
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
Object[] pdus=(Object[])intent.getExtras().get("pdus");
SmsMessage shortMessage=SmsMessage.createFromPdu((byte[]) pdus[0]);
if(shortMessage.getDisplayMessageBody().contains("//keyword")){
abortBroadcast();
}
hope it help you :)))