title: How to read sms sender's name?
body: <p>I use Uri.parse("content://sms/inbox") to read SMSs, but I can't figure how to read the sender's name. I went through similar questions but couldn't find clear answers, only suggestions to use:</p>
  
  <pre><code>ContentResolver cr = getContentResolver();
  Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null,null, null);
  String name = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
  </code></pre>
  
  <p>Which give me the name of my contacts but not the specific name for every SMS.</p>
  
  <p>By the way, when I use "body", it show me all of my SMS's history. Is there a way to check like:</p>
  
  <pre><code>messageString = cursor.getString(0); //let's say 0 is "body"
  (messageString == "HI") txt.setText("BYE");
  </code></pre>
  
  <p>and not just get the full inbox content?﻿ </p>