Android Open Source - SMSForward S M S Receiver






From Project

Back to project page SMSForward.

License

The source code is released under:

Icon is combined from https://github.com/google/material-design-icons

If you think the Android project SMSForward listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.wimy.smsforward;
// w w w .  ja va  2s  .  com
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.provider.Telephony;
import android.telephony.SmsMessage;

public class SMSReceiver extends BroadcastReceiver {

  @Override
  public void onReceive(Context context, Intent intent) {
    SmsMessage[] sms_messages = Telephony.Sms.Intents.getMessagesFromIntent(intent);
    
    for ( SmsMessage message : sms_messages) {
      String message_body = message.getMessageBody();
      if (message_body != null) {
        MainActivity.onReceivedSMS(context, message_body);
      }
    }
  }
}




Java Source Code List

com.wimy.smsforward.MainActivity.java
com.wimy.smsforward.SMSReceiver.java