简体   繁体   English

如何在双卡手机中仅获取一张SIM卡的短信?

[英]How to fetch SMS of only one SIM in dual SIM phone?

I am working with SMS functionalities on Android. 我在Android上使用SMS功能。 I have successfully fetched all the SMS from the phone and I want to filter those SMS by SIM 1 and SIM 2. I have checked the columns (the query to fetch SMS is returning) but can't figure out which column indicates SIM information 我已成功从手机中取出所有短信,我想通过SIM 1和SIM 2过滤这些短信。我检查了列(提取短信的查询正在返回),但无法确定哪一列表示SIM信息

I am using this to get all SMS 我用它来获取所有短信

Uri uriSMSURI = Uri.parse("content://sms/");
Cursor cur = activity.getContentResolver().query(uriSMSURI, null, "thread_id = "+thread, null, "_id DESC LIMIT "+limit +" offset "+(limit*page));

This returns all SMS but I want SMS from one SIM card only. 这将返回所有短信,但我只想从一张SIM卡发送短信。

Any help or suggestion is welcome 欢迎任何帮助或建议

well this are all the Columns for Threads I couldn't find anything related to sim though . 这是所有的线程列我虽然找不到任何与sim相关的东西。 But there is RECIPIENT_IDS : 但是有RECIPIENT_IDS

A string encoding of the recipient IDs of the recipients of the message, in numerical order and separated by spaces. 邮件收件人的收件人ID的字符串编码,按数字顺序并用空格分隔。

Which you can check it by the sim number for received messages. 您可以通过SIM号码检查收到的消息。 also you have SMS wich contains PERSON , ADRESS , CREATOR which you can also check them by sim number. 你也有短信包含PERSONADRESSCREATOR ,你也可以通过SIM卡号检查它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM