Find and interate all SMS/MMS messages in android
<p>First and foremost, I found this <a href="https://stackoverflow.com/a/6446831/2415237">answer</a> particularly helpful.  However, it made me wonder how one goes about finding such information.  </p>

<p>I can't seem to figure out how to iterate all the messages in my inbox.  My current solution uses <code>Uri.parse("content://mms-sms/conversations")</code> in which I give use "_id" and "ct_t".  However, it seems I only find the three conversations in my phone despite having 30 msges (20 of them in the save conversation thread and the others divided between two other conversations).  Would make sense for such a statement <code>content://mms-sms/conversations</code>.  However, the other providers seem to deal only with SMS OR MMS.  Isn't there a way to just iterate the entire list of messages in this fashion where I replace <code>"content://mms-sms/conversations"</code> with something else?</p>

<pre><code>public boolean refresh() {
    final String[] proj = new String[]{"_id","ct_t"};
    cursor = cr.query(Uri.parse("content://mms-sms/conversations"),proj,null,null,null);
    if(!(cursor.moveToFirst())) {
        empty = true;
        cursor.close();
        return false;
    }
    return true;
}
</code></pre>

<p>I iterate the messages with a next function</p>

<pre><code>    public boolean next() {

        if(empty) {
            cursor.close();
            return false;
        }
        msgCnt = msgCnt + 1;

        Msg msg;
        String msgData = cursor.getString(cursor.getColumnIndex("ct_t"));
        if("application/cnd.wap.multipart.related".equals(msgData)) {
            msg = ParseMMS(cursor.getString(cursor.getColumnIndex("_id")));
        } else {
            msg = ParseSMS(cursor.getString(cursor.getColumnIndex("_id")));
        }


        if(!(cursor.moveToNext())) {
            empty = true;
            cursor.close();
            return false;
        }

        return true;
    }
</code></pre>