I am able to fetch all the SMS from a particular sender id from the inbox but I also want the mobile number in which the SMS is received in case of dual sim android hone please suggest me an answer which works for all devices
Uri mSmsinboxQueryUri = Uri.parse("content://sms/inbox");
Cursor cursor = context.getContentResolver().query(mSmsinboxQueryUri, new String[]{"_id",
"thread_id", "address", "person", "date", "body", "type"}, null,
null, null);
if (cursor != null) {
cursor.moveToFirst();
while (cursor.moveToNext()) {
String thread_id = cursor.getString(1);
String address = cursor.getString(2);
String person = cursor.getString(3);
String date = cursor.getString(4);
String body = cursor.getString(5);
String type = cursor.getString(6);}}