Android Open Source - android_smsoverxmpp Sms Receiver






From Project

Back to project page android_smsoverxmpp.

License

The source code is released under:

GNU General Public License

If you think the Android project android_smsoverxmpp 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.smorra.smsoverxmpp;
//w  w w  . ja v a 2 s  .  c  o m
import android.content.ContentValues;
import android.content.Context;
import android.database.ContentObserver;
import android.net.Uri;
import android.os.Handler;

public class SmsReceiver extends ContentObserver
{
  Context context;

  public SmsReceiver(Handler handler, Context context)
  {
    super(handler);
    this.context = context;
  }

  @Override
  public void onChange(boolean arg)
  {
    System.out.println("ONCHANGE");
    try
    {
      if (Service_.onSmsReceived())
      {
        ContentValues values = new ContentValues();
        values.put("read", 1);
        context.getContentResolver().update(Uri.parse("content://sms/inbox"), values, null, null);
      }
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }


}




Java Source Code List

com.smorra.smsoverxmpp.BootReceiver.java
com.smorra.smsoverxmpp.Client.java
com.smorra.smsoverxmpp.Contact.java
com.smorra.smsoverxmpp.IpReceiver.java
com.smorra.smsoverxmpp.MainActivity.java
com.smorra.smsoverxmpp.PhoneNumber.java
com.smorra.smsoverxmpp.Server.java
com.smorra.smsoverxmpp.Service_.java
com.smorra.smsoverxmpp.SmsReceiver.java
com.smorra.smsoverxmpp.Util.java