-2

I have just one question. How can I get SMS content(messages) for phone number

input --> output
785453884 --> messegaes "some text1"

  • 1
    Possible duplicate of http://stackoverflow.com/questions/10870230/read-all-sms-from-a-particular-sender – Ofir Ohayon Jun 24 '15 at 19:27
  • So i need use this query
    'code'Cursor cur = getContentResolver().query(uri, projection, "address='123456789'", null, "date desc");
    and change adress for each of my adress (i try make app where is sms history for all number)
    – Paweł Gaweł Jun 24 '15 at 19:39

1 Answers1

0

Refer this link

Using following lines you will get the number of the person who sent the SMS.

SmsMessage SMessage = SmsMessage.createFromPdu((byte[]) pdus[i]);
String sender = SMessage.getOriginatingAddress();

Using condition you can check specific senders number.

Ofir Ohayon
  • 367
  • 2
  • 18