Goal: I'm trying to group SMS and calls from same (known) contacts.
- I read SMS using
Telephony.Sms.Inbox.CONTENT_URIandTelephone.Sms.Sent.CONTENT_URI. - I read calls using
CallLog.Calls.CONTENT_UTI.
I get the contact's ID by following android is CallLog.Calls._ID the same with the contact id?: using Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, phoneNumber).
Now, having this PhoneLookup._ID, I want to list SMS from that contact.
Sadly Telephony.Sms.PERSON does not seem to store the same contact ID.
Question: How could I list SMS from that PhoneLookup._ID or if not possible, how could I achieve what I want: list SMS and calls from the same contact.
PS: Telephony.TextBasedSmsColumns.PERSON seems to refer the the deprecated Contacts.People API...
Telephony.Sms.PERSONactually matchsContactsContract.DataColumns.RAW_CONTACT_ID.So I used:
Reading
ContactsContract.DataColumns.RAW_CONTACT_ID.https://developer.android.com/reference/android/provider/ContactsContract.DataColumns.html#RAW_CONTACT_ID