Note that there are some explanatory texts on larger screens.

plurals
  1. POOverride default android messaging application
    primarykey
    data
    text
    <p>I want to override the default android messaging application. If I receive a sms or mms I want to send that to email but i don't want any notification on phone. So basically I want to replace the default messaging application. </p> <p>How can I make my application the default one that receive the sms?</p> <hr> <p>Thanks a lot. That is exactly what I need. But I have one more problem. I used the receiver to get the message ... but I don't know how to find the message in the phone and mark it as read.</p> <pre><code>public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub //---get the SMS message passed in--- Bundle bundle = intent.getExtras(); SmsMessage[] msgs = null; String str = ""; if (bundle != null) { //---retrieve the SMS message received--- Object[] pdus = (Object[]) bundle.get("pdus"); msgs = new SmsMessage[pdus.length]; for (int i=0; i&lt;msgs.length; i++){ msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]); str += "SMS from " + msgs[i].getOriginatingAddress(); str += " :"; str += msgs[i].getMessageBody().toString(); str += "\n"; } //---display the new SMS message--- Toast.makeText(context, str, Toast.LENGTH_SHORT).show(); //---find and mark the messages as read--- Uri uriSms = Uri.parse("content://sms/inbox/"); try{ Cursor c = context.getContentResolver().query(uriSms, null,null,null,null); //---code to find the message by body and sender--- ... } </code></pre> <p>Is there any way in which I can identify the message like an id? Now I find the message comparing the bofy and sender number for all messages in inbox. </p> <p>Thanks, Radu</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload