Android Open Source - LibreText-to-PC S M S Receiver






From Project

Back to project page LibreText-to-PC.

License

The source code is released under:

GNU General Public License

If you think the Android project LibreText-to-PC 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 matxorapps.com.libretext_to_pc;
/*from ww w. ja v a  2s  .  c o m*/

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.util.Log;
import android.widget.Toast;

/**
 * Created by Mostsb on 21/01/2015.
 */
public class SMSReceiver extends BroadcastReceiver {

   public void onReceive(Context context, Intent intent){
       Bundle pudsBundle = intent.getExtras();
       Object[] pdus = (Object[]) pudsBundle.get("pdus");
       SmsMessage messages = SmsMessage.createFromPdu((byte[]) pdus[0]);
       SMSService.pushSMS(messages.getMessageBody(),messages.getOriginatingAddress());


   }

}




Java Source Code List

matxorapps.com.libretext_to_pc.ApplicationTest.java
matxorapps.com.libretext_to_pc.MainActivity.java
matxorapps.com.libretext_to_pc.SMSReceiver.java
matxorapps.com.libretext_to_pc.SMSService.java