package cn.sunner.sms2calendar;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class SMSReceiver extends BroadcastReceiver {
    public SMSReceiver() {
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO: This method is called when the BroadcastReceiver is receiving
        // an Intent broadcast.
        throw new UnsupportedOperationException("Not yet implemented");
    }
}

@@ -130,16 +130,104 @@
 .Intent;
+%0Aimport android.os.Bundle;%0Aimport android.telephony.SmsMessage;%0Aimport android.util.Log;
 %0A%0Apublic
@@ -273,16 +273,53 @@
 eiver %7B%0A
+    private String TAG = %22SMS2Cal%22;%0A%0A
     publ
@@ -433,179 +433,924 @@
  // 
-TODO: This method is called when the BroadcastReceiver is receiving%0A        // an Intent broadcast.%0A        throw new UnsupportedOperationException(%22Not yet implemented%22);
+Get the data (SMS data) bound to intent%0A        Bundle bundle = intent.getExtras();%0A%0A        SmsMessage%5B%5D msgs = null;%0A%0A        String str = %22%22;%0A%0A        if (bundle != null) %7B%0A            // Retrieve the SMS Messages received%0A            Object%5B%5D pdus = (Object%5B%5D) bundle.get(%22pdus%22);%0A            msgs = new SmsMessage%5Bpdus.length%5D;%0A%0A            // For every SMS message received%0A            for (int i=0; i %3C msgs.length; i++) %7B%0A                // Convert Object array%0A                msgs%5Bi%5D = SmsMessage.createFromPdu((byte%5B%5D) pdus%5Bi%5D);%0A                // Sender's phone number%0A                str += %22SMS from %22 + msgs%5Bi%5D.getOriginatingAddress() + %22 : %22;%0A                // Fetch the text message%0A                str += msgs%5Bi%5D.getMessageBody().toString();%0A                // Newline%0A                str += %22%5Cn%22;%0A            %7D%0A%0A            // Display the entire SMS Message%0A            Log.d(TAG, str);%0A        %7D
 %0A   

Read SMS framwork