android+查询彩信号码,android 短信 彩信 数据库
转自:http://gnibre.javaeye.com/blog/558031
短信 sms
文件 /data/data/com.android.providers.telephony/databases/mmssms.db
这个数据库有13张表,sms表存了短信信息。
sms表的uri是
Java代码
publicstaticfinalUri CONTENT_URI =
Uri.parse("content://sms");
public static final Uri CONTENT_URI =
Uri.parse("content://sms");
表项含义,我猜的
0 _id
1 thread_id 在短信界面里显示在第几组( 相同联系人的短信在同意行),英文名叫话题。
2 address 电话好吗
3 person ? 存在电话簿里的名字 。 可能吧
4 date 日期
5 protocol ?..
6 read ? 1- 已读 0-未读
7 status ?
8 type ? 2 我发送
9 reply_path_present ?
10 subject
11 body 短信内容
12 service_center ...
好没信息量。。。。
把源码补上。
在frameworks/base/core/java/android/provider/Telephony.java
Java代码
/**
* The thread ID of the message
*
Type: INTEGER
*/
publicstaticfinalString THREAD_ID ="thread_id";
/**
* The address of the other party
*
Type: TEXT
*/
publicstaticfinalString ADDRESS ="address";
/**
* The person ID of the sender
*
Type: INTEGER (long)
*/
publicstaticfinalString PERSON_ID ="person";
/**
* The date the message was sent
*
Type: INTEGER (long)
*/
publicstaticfinalString DATE ="date";
/**
* The protocol identifier code
*
Type: INTEGER
*/
publicstaticfinalString PROTOCOL ="protocol";
/**
* Has the message been read
*
Type: INTEGER (boolean)
*/
publicstaticfinalString READ ="read";
/**
* The TP-Status value for the message, or -1 if no status has
* been received
*/
publicstaticfinalString STATUS ="status";
us 举例:
publicstaticfinalintSTATUS_NONE = -1;
publicstaticfinalintSTATUS_COMPLETE =0;
publicstaticfinalintSTATUS_PENDING =64;
publicstaticfinalintSTATUS_FAILED =128;
/**
* The type of the message
*
Type: INTEGER
*/
publicstaticfinalString TYPE ="type";
举例
publicstaticfinalintMESSAGE_TYPE_ALL =0;
publicstaticfinalintMESSAGE_TYPE_INBOX =1;
publicstaticfinalintMESSAGE_TYPE_SENT =2;
publicstaticfinalintMESSAGE_TYPE_DRAFT =3;
publicstaticfinalintMESSAGE_TYPE_OUTBOX =4;
publicstaticfinalintMESSAGE_TYPE_FAILED =5;// for failed outgoing messages
publicstaticfinalintMESSAGE_TYPE_QUEUED =6;// for messages to send later
/**
* Whether the TP-Reply-Path
bit was set on this message
*
Type: BOOLEAN
*/
publicstaticfinalString REPLY_PATH_PRESENT ="reply_path_present";
/**
* The subject of the message, if present
*
Type: TEXT
*/
publicstaticfinalString SUBJECT ="subject";
/**
* The body of the message
*
Type: TEXT
*/
publicstaticfinalString BODY ="body";
/**
* The service center (SC) through which to send the message, if present
*
Type: TEXT
*/
publicstaticfinalString SERVICE_CENTER ="service_center";
/**
* Has the message been locked?
*
Type: INTEGER (boolean)
*/
publicstaticfinalString LOCKED ="locked";
**
* The id of the sender of the conversation, ifpresent
*
Type: INTEGER (reference to item in content://contacts/people)
*/
publicstaticfinalString PERSON ="person";
/**
* The thread ID of the message
*
Type: INTEGER
*/
public static final String THREAD_ID = "thread_id";
/**
* The address of the other party
*
Type: TEXT
*/
public static final String ADDRESS = "address";
/**
* The person ID of the sender
*
Type: INTEGER (long)
*/
public static final String PERSON_ID = "person";
/**
* The date the message was sent
*
Type: INTEGER (long)
*/
public static final String DATE = "date";
/**
* The protocol identifier code
*
Type: INTEGER
*/
public static final String PROTOCOL = "protocol";
/**
* Has the message been read
*
Type: INTEGER (boolean)
*/
public static final String READ = "read";
/**
* The TP-Status value for the message, or -1 if no status has
* been received
*/
public static final String STATUS = "status";
// status 举例:
public static final int STATUS_NONE = -1;
public static final int STATUS_COMPLETE = 0;
public static final int STATUS_PENDING = 64;
public static final int STATUS_FAILED = 128;
/**
* The type of the message
*
Type: INTEGER
*/
public static final String TYPE = "type";
// type 举例
public static final int MESSAGE_TYPE_ALL = 0;
public static final int MESSAGE_TYPE_INBOX = 1;
public static final int MESSAGE_TYPE_SENT = 2;
public static final int MESSAGE_TYPE_DRAFT = 3;
public static final int MESSAGE_TYPE_OUTBOX = 4;
public static final int MESSAGE_TYPE_FAILED = 5; // for failed outgoing messages
public static final int MESSAGE_TYPE_QUEUED = 6; // for messages to send later
/**
* Whether the TP-Reply-Path
bit was set on this message
*
Type: BOOLEAN
*/
public static final String REPLY_PATH_PRESENT = "reply_path_present";
/**
* The subject of the message, if present
*
Type: TEXT
*/
public static final String SUBJECT = "subject";
/**
* The body of the message
*
Type: TEXT
*/
public static final String BODY = "body";
/**
* The service center (SC) through which to send the message, if present
*
Type: TEXT
*/
public static final String SERVICE_CENTER = "service_center";
// 另外还有
/**
* Has the message been locked?
*
Type: INTEGER (boolean)
*/
public static final String LOCKED = "locked";
/**
* The id of the sender of the conversation, if present
*
Type: INTEGER (reference to item in content://contacts/people)
*/
public static final String PERSON = "person";
彩信。
1、pdu表
mmssms.db库中的pdu表存储了彩信标题、彩信接收时间和彩信ID等信息,其中“_id”是主键,唯一标识了一个条彩信。
pdu 表源码
Java代码
/**
* Base columns for tables that contain MMSs.
*/
publicinterfaceBaseMmsColumnsextendsBaseColumns {
publicstaticfinalintMESSAGE_BOX_ALL =0;
publicstaticfinalintMESSAGE_BOX_INBOX =1;
publicstaticfinalintMESSAGE_BOX_SENT =2;
publicstaticfinalintMESSAGE_BOX_DRAFTS =3;
publicstaticfinalintMESSAGE_BOX_OUTBOX =4;
/**
* The date the message was sent.
*
Type: INTEGER (long)
*/
publicstaticfinalString DATE ="date";
/**
* The box which the message belong to, for example, MESSAGE_BOX_INBOX.
*
Type: INTEGER
*/
publicstaticfinalString MESSAGE_BOX ="msg_box";
/**
* Has the message been read.
*
Type: INTEGER (boolean)
*/
publicstaticfinalString READ ="read";
/**
* The Message-ID of the message.
*
Type: TEXT
*/
publicstaticfinalString MESSAGE_ID ="m_id";
/**
* The subject of the message, if present.
*
Type: TEXT
*/
publicstaticfinalString SUBJECT ="sub";
/**
* The character set of the subject, if present.
*
Type: INTEGER
*/
publicstaticfinalString SUBJECT_CHARSET ="sub_cs";
/**
* The Content-Type of the message.
*
Type: TEXT
*/
publicstaticfinalString CONTENT_TYPE ="ct_t";
/**
* The Content-Location of the message.
*
Type: TEXT
*/
publicstaticfinalString CONTENT_LOCATION ="ct_l";
/**
* The address of the sender.
*
Type: TEXT
*/
publicstaticfinalString FROM ="from";
/**
* The address of the recipients.
*
Type: TEXT
*/
publicstaticfinalString TO ="to";
/**
* The address of the cc. recipients.
*
Type: TEXT
*/
publicstaticfinalString CC ="cc";
/**
* The address of the bcc. recipients.
*
Type: TEXT
*/
publicstaticfinalString BCC ="bcc";
/**
* The expiry time of the message.
*
Type: INTEGER
*/
publicstaticfinalString EXPIRY ="exp";
/**
* The class of the message.
*
Type: TEXT
*/
publicstaticfinalString MESSAGE_CLASS ="m_cls";
/**
* The type of the message defined by MMS spec.
*
Type: INTEGER
*/
publicstaticfinalString MESSAGE_TYPE ="m_type";
/**
* The version of specification that this message conform.
*
Type: INTEGER
*/
publicstaticfinalString MMS_VERSION ="v";
/**
* The size of the message.
*
Type: INTEGER
*/
publicstaticfinalString MESSAGE_SIZE ="m_size";
/**
* The priority of the message.
*
Type: TEXT
*/
publicstaticfinalString PRIORITY ="pri";
/**
* The read-report of the message.
*
Type: TEXT
*/
publicstaticfinalString READ_REPORT ="rr";
/**
* Whether the report is allowed.
*
Type: TEXT
*/
publicstaticfinalString REPORT_ALLOWED ="rpt_a";
/**
* The response-status of the message.
*
Type: INTEGER
*/
publicstaticfinalString RESPONSE_STATUS ="resp_st";
/**
* The status of the message.
*
Type: INTEGER
*/
publicstaticfinalString STATUS ="st";
/**
* The transaction-id of the message.
*
Type: TEXT
*/
publicstaticfinalString TRANSACTION_ID ="tr_id";
/**
* The retrieve-status of the message.
*
Type: INTEGER
*/
publicstaticfinalString RETRIEVE_STATUS ="retr_st";
/**
* The retrieve-text of the message.
*
Type: TEXT
*/
publicstaticfinalString RETRIEVE_TEXT ="retr_txt";
/**
* The character set of the retrieve-text.
*
Type: TEXT
*/
publicstaticfinalString RETRIEVE_TEXT_CHARSET ="retr_txt_cs";
/**
* The read-status of the message.
*
Type: INTEGER
*/
publicstaticfinalString READ_STATUS ="read_status";
/**
* The content-class of the message.
*
Type: INTEGER
*/
publicstaticfinalString CONTENT_CLASS ="ct_cls";
/**
* The delivery-report of the message.
*
Type: INTEGER
*/
publicstaticfinalString DELIVERY_REPORT ="d_rpt";
/**
* The delivery-time-token of the message.
*
Type: INTEGER
*/
publicstaticfinalString DELIVERY_TIME_TOKEN ="d_tm_tok";
/**
* The delivery-time of the message.
*
Type: INTEGER
*/
publicstaticfinalString DELIVERY_TIME ="d_tm";
/**
* The response-text of the message.
*
Type: TEXT
*/
publicstaticfinalString RESPONSE_TEXT ="resp_txt";
/**
* The sender-visibility of the message.
*
Type: TEXT
*/
publicstaticfinalString SENDER_VISIBILITY ="s_vis";
/**
* The reply-charging of the message.
*
Type: INTEGER
*/
publicstaticfinalString REPLY_CHARGING ="r_chg";
/**
* The reply-charging-deadline-token of the message.
*
Type: INTEGER
*/
publicstaticfinalString REPLY_CHARGING_DEADLINE_TOKEN ="r_chg_dl_tok";
/**
* The reply-charging-deadline of the message.
*
Type: INTEGER
*/
publicstaticfinalString REPLY_CHARGING_DEADLINE ="r_chg_dl";
/**
* The reply-charging-id of the message.
*
Type: TEXT
*/
publicstaticfinalString REPLY_CHARGING_ID ="r_chg_id";
/**
* The reply-charging-size of the message.
*
Type: INTEGER
*/
publicstaticfinalString REPLY_CHARGING_SIZE ="r_chg_sz";
/**
* The previously-sent-by of the message.
*
Type: TEXT
*/
publicstaticfinalString PREVIOUSLY_SENT_BY ="p_s_by";
/**
* The previously-sent-date of the message.
*
Type: INTEGER
*/
publicstaticfinalString PREVIOUSLY_SENT_DATE ="p_s_d";
/**
* The store of the message.
*
Type: TEXT
*/
publicstaticfinalString STORE ="store";
/**
* The mm-state of the message.
*
Type: INTEGER
*/
publicstaticfinalString MM_STATE ="mm_st";
/**
* The mm-flags-token of the message.
*
Type: INTEGER
*/
publicstaticfinalString MM_FLAGS_TOKEN ="mm_flg_tok";
/**
* The mm-flags of the message.
*
Type: TEXT
*/
publicstaticfinalString MM_FLAGS ="mm_flg";
/**
* The store-status of the message.
*
Type: TEXT
*/
publicstaticfinalString STORE_STATUS ="store_st";
/**
* The store-status-text of the message.
*
Type: TEXT
*/
publicstaticfinalString STORE_STATUS_TEXT ="store_st_txt";
/**
* The stored of the message.
*
Type: TEXT
*/
publicstaticfinalString STORED ="stored";
/**
* The totals of the message.
*
Type: TEXT
*/
publicstaticfinalString TOTALS ="totals";
/**
* The mbox-totals of the message.
*
Type: TEXT
*/
publicstaticfinalString MBOX_TOTALS ="mb_t";
/**
* The mbox-totals-token of the message.
*
Type: INTEGER
*/
publicstaticfinalString MBOX_TOTALS_TOKEN ="mb_t_tok";
/**
* The quotas of the message.
*
Type: TEXT
*/
publicstaticfinalString QUOTAS ="qt";
/**
* The mbox-quotas of the message.
*
Type: TEXT
*/
publicstaticfinalString MBOX_QUOTAS ="mb_qt";
/**
* The mbox-quotas-token of the message.
*
Type: INTEGER
*/
publicstaticfinalString MBOX_QUOTAS_TOKEN ="mb_qt_tok";
/**
* The message-count of the message.
*
Type: INTEGER
*/
publicstaticfinalString MESSAGE_COUNT ="m_cnt";
/**
* The start of the message.
*
Type: INTEGER
*/
publicstaticfinalString START ="start";
/**
* The distribution-indicator of the message.
*
Type: TEXT
*/
publicstaticfinalString DISTRIBUTION_INDICATOR ="d_ind";
/**
* The element-descriptor of the message.
*
Type: TEXT
*/
publicstaticfinalString ELEMENT_DESCRIPTOR ="e_des";
/**
* The limit of the message.
*
Type: INTEGER
*/
publicstaticfinalString LIMIT ="limit";
/**
* The recommended-retrieval-mode of the message.
*
Type: INTEGER
*/
publicstaticfinalString RECOMMENDED_RETRIEVAL_MODE ="r_r_mod";
/**
* The recommended-retrieval-mode-text of the message.
*
Type: TEXT
*/
publicstaticfinalString RECOMMENDED_RETRIEVAL_MODE_TEXT ="r_r_mod_txt";
/**
* The status-text of the message.
*
Type: TEXT
*/
publicstaticfinalString STATUS_TEXT ="st_txt";
/**
* The applic-id of the message.
*
Type: TEXT
*/
publicstaticfinalString APPLIC_ID ="apl_id";
/**
* The reply-applic-id of the message.
*
Type: TEXT
*/
publicstaticfinalString REPLY_APPLIC_ID ="r_apl_id";
/**
* The aux-applic-id of the message.
*
Type: TEXT
*/
publicstaticfinalString AUX_APPLIC_ID ="aux_apl_id";
/**
* The drm-content of the message.
*
Type: TEXT
*/
publicstaticfinalString DRM_CONTENT ="drm_c";
/**
* The adaptation-allowed of the message.
*
Type: TEXT
*/
publicstaticfinalString ADAPTATION_ALLOWED ="adp_a";
/**
* The replace-id of the message.
*
Type: TEXT
*/
publicstaticfinalString REPLACE_ID ="repl_id";
/**
* The cancel-id of the message.
*
Type: TEXT
*/
publicstaticfinalString CANCEL_ID ="cl_id";
/**
* The cancel-status of the message.
*
Type: INTEGER
*/
publicstaticfinalString CANCEL_STATUS ="cl_st";
/**
* The thread ID of the message
*
Type: INTEGER
*/
publicstaticfinalString THREAD_ID ="thread_id";
/**
* Has the message been locked?
*
Type: INTEGER (boolean)
*/
publicstaticfinalString LOCKED ="locked";
}
/**
* Base columns for tables that contain MMSs.
*/
public interface BaseMmsColumns extends BaseColumns {
public static final int MESSAGE_BOX_ALL = 0;
public static final int MESSAGE_BOX_INBOX = 1;
public static final int MESSAGE_BOX_SENT = 2;
public static final int MESSAGE_BOX_DRAFTS = 3;
public static final int MESSAGE_BOX_OUTBOX = 4;
/**
* The date the message was sent.
*
Type: INTEGER (long)
*/
public static final String DATE = "date";
/**
* The box which the message belong to, for example, MESSAGE_BOX_INBOX.
*
Type: INTEGER
*/
public static final String MESSAGE_BOX = "msg_box";
/**
* Has the message been read.
*
Type: INTEGER (boolean)
*/
public static final String READ = "read";
/**
* The Message-ID of the message.
*
Type: TEXT
*/
public static final String MESSAGE_ID = "m_id";
/**
* The subject of the message, if present.
*
Type: TEXT
*/
public static final String SUBJECT = "sub";
/**
* The character set of the subject, if present.
*
Type: INTEGER
*/
public static final String SUBJECT_CHARSET = "sub_cs";
/**
* The Content-Type of the message.
*
Type: TEXT
*/
public static final String CONTENT_TYPE = "ct_t";
/**
* The Content-Location of the message.
*
Type: TEXT
*/
public static final String CONTENT_LOCATION = "ct_l";
/**
* The address of the sender.
*
Type: TEXT
*/
public static final String FROM = "from";
/**
* The address of the recipients.
*
Type: TEXT
*/
public static final String TO = "to";
/**
* The address of the cc. recipients.
*
Type: TEXT
*/
public static final String CC = "cc";
/**
* The address of the bcc. recipients.
*
Type: TEXT
*/
public static final String BCC = "bcc";
/**
* The expiry time of the message.
*
Type: INTEGER
*/
public static final String EXPIRY = "exp";
/**
* The class of the message.
*
Type: TEXT
*/
public static final String MESSAGE_CLASS = "m_cls";
/**
* The type of the message defined by MMS spec.
*
Type: INTEGER
*/
public static final String MESSAGE_TYPE = "m_type";
/**
* The version of specification that this message conform.
*
Type: INTEGER
*/
public static final String MMS_VERSION = "v";
/**
* The size of the message.
*
Type: INTEGER
*/
public static final String MESSAGE_SIZE = "m_size";
/**
* The priority of the message.
*
Type: TEXT
*/
public static final String PRIORITY = "pri";
/**
* The read-report of the message.
*
Type: TEXT
*/
public static final String READ_REPORT = "rr";
/**
* Whether the report is allowed.
*
Type: TEXT
*/
public static final String REPORT_ALLOWED = "rpt_a";
/**
* The response-status of the message.
*
Type: INTEGER
*/
public static final String RESPONSE_STATUS = "resp_st";
/**
* The status of the message.
*
Type: INTEGER
*/
public static final String STATUS = "st";
/**
* The transaction-id of the message.
*
Type: TEXT
*/
public static final String TRANSACTION_ID = "tr_id";
/**
* The retrieve-status of the message.
*
Type: INTEGER
*/
public static final String RETRIEVE_STATUS = "retr_st";
/**
* The retrieve-text of the message.
*
Type: TEXT
*/
public static final String RETRIEVE_TEXT = "retr_txt";
/**
* The character set of the retrieve-text.
*
Type: TEXT
*/
public static final String RETRIEVE_TEXT_CHARSET = "retr_txt_cs";
/**
* The read-status of the message.
*
Type: INTEGER
*/
public static final String READ_STATUS = "read_status";
/**
* The content-class of the message.
*
Type: INTEGER
*/
public static final String CONTENT_CLASS = "ct_cls";
/**
* The delivery-report of the message.
*
Type: INTEGER
*/
public static final String DELIVERY_REPORT = "d_rpt";
/**
* The delivery-time-token of the message.
*
Type: INTEGER
*/
public static final String DELIVERY_TIME_TOKEN = "d_tm_tok";
/**
* The delivery-time of the message.
*
Type: INTEGER
*/
public static final String DELIVERY_TIME = "d_tm";
/**
* The response-text of the message.
*
Type: TEXT
*/
public static final String RESPONSE_TEXT = "resp_txt";
/**
* The sender-visibility of the message.
*
Type: TEXT
*/
public static final String SENDER_VISIBILITY = "s_vis";
/**
* The reply-charging of the message.
*
Type: INTEGER
*/
public static final String REPLY_CHARGING = "r_chg";
/**
* The reply-charging-deadline-token of the message.
*
Type: INTEGER
*/
public static final String REPLY_CHARGING_DEADLINE_TOKEN = "r_chg_dl_tok";
/**
* The reply-charging-deadline of the message.
*
Type: INTEGER
*/
public static final String REPLY_CHARGING_DEADLINE = "r_chg_dl";
/**
* The reply-charging-id of the message.
*
Type: TEXT
*/
public static final String REPLY_CHARGING_ID = "r_chg_id";
/**
* The reply-charging-size of the message.
*
Type: INTEGER
*/
public static final String REPLY_CHARGING_SIZE = "r_chg_sz";
/**
* The previously-sent-by of the message.
*
Type: TEXT
*/
public static final String PREVIOUSLY_SENT_BY = "p_s_by";
/**
* The previously-sent-date of the message.
*
Type: INTEGER
*/
public static final String PREVIOUSLY_SENT_DATE = "p_s_d";
/**
* The store of the message.
*
Type: TEXT
*/
public static final String STORE = "store";
/**
* The mm-state of the message.
*
Type: INTEGER
*/
public static final String MM_STATE = "mm_st";
/**
* The mm-flags-token of the message.
*
Type: INTEGER
*/
public static final String MM_FLAGS_TOKEN = "mm_flg_tok";
/**
* The mm-flags of the message.
*
Type: TEXT
*/
public static final String MM_FLAGS = "mm_flg";
/**
* The store-status of the message.
*
Type: TEXT
*/
public static final String STORE_STATUS = "store_st";
/**
* The store-status-text of the message.
*
Type: TEXT
*/
public static final String STORE_STATUS_TEXT = "store_st_txt";
/**
* The stored of the message.
*
Type: TEXT
*/
public static final String STORED = "stored";
/**
* The totals of the message.
*
Type: TEXT
*/
public static final String TOTALS = "totals";
/**
* The mbox-totals of the message.
*
Type: TEXT
*/
public static final String MBOX_TOTALS = "mb_t";
/**
* The mbox-totals-token of the message.
*
Type: INTEGER
*/
public static final String MBOX_TOTALS_TOKEN = "mb_t_tok";
/**
* The quotas of the message.
*
Type: TEXT
*/
public static final String QUOTAS = "qt";
/**
* The mbox-quotas of the message.
*
Type: TEXT
*/
public static final String MBOX_QUOTAS = "mb_qt";
/**
* The mbox-quotas-token of the message.
*
Type: INTEGER
*/
public static final String MBOX_QUOTAS_TOKEN = "mb_qt_tok";
/**
* The message-count of the message.
*
Type: INTEGER
*/
public static final String MESSAGE_COUNT = "m_cnt";
/**
* The start of the message.
*
Type: INTEGER
*/
public static final String START = "start";
/**
* The distribution-indicator of the message.
*
Type: TEXT
*/
public static final String DISTRIBUTION_INDICATOR = "d_ind";
/**
* The element-descriptor of the message.
*
Type: TEXT
*/
public static final String ELEMENT_DESCRIPTOR = "e_des";
/**
* The limit of the message.
*
Type: INTEGER
*/
public static final String LIMIT = "limit";
/**
* The recommended-retrieval-mode of the message.
*
Type: INTEGER
*/
public static final String RECOMMENDED_RETRIEVAL_MODE = "r_r_mod";
/**
* The recommended-retrieval-mode-text of the message.
*
Type: TEXT
*/
public static final String RECOMMENDED_RETRIEVAL_MODE_TEXT = "r_r_mod_txt";
/**
* The status-text of the message.
*
Type: TEXT
*/
public static final String STATUS_TEXT = "st_txt";
/**
* The applic-id of the message.
*
Type: TEXT
*/
public static final String APPLIC_ID = "apl_id";
/**
* The reply-applic-id of the message.
*
Type: TEXT
*/
public static final String REPLY_APPLIC_ID = "r_apl_id";
/**
* The aux-applic-id of the message.
*
Type: TEXT
*/
public static final String AUX_APPLIC_ID = "aux_apl_id";
/**
* The drm-content of the message.
*
Type: TEXT
*/
public static final String DRM_CONTENT = "drm_c";
/**
* The adaptation-allowed of the message.
*
Type: TEXT
*/
public static final String ADAPTATION_ALLOWED = "adp_a";
/**
* The replace-id of the message.
*
Type: TEXT
*/
public static final String REPLACE_ID = "repl_id";
/**
* The cancel-id of the message.
*
Type: TEXT
*/
public static final String CANCEL_ID = "cl_id";
/**
* The cancel-status of the message.
*
Type: INTEGER
*/
public static final String CANCEL_STATUS = "cl_st";
/**
* The thread ID of the message
*
Type: INTEGER
*/
public static final String THREAD_ID = "thread_id";
/**
* Has the message been locked?
*
Type: INTEGER (boolean)
*/
public static final String LOCKED = "locked";
}
2、part表
mmssms.db库中的part表存储了彩信内容(文本、音乐、图象)的文件名(即上面将的app_parts下面的文件名)、文件类型信息。
其中“mid”对应着pdu表中的“_id”,“ct”是文件类型,“_data”是存储路径。
3 。 彩信文件读取
彩信附件文件的地址存储在mmssms.db的part表的_data字段,形如“/data/data /com.android.providers.telephony/app_parts/PART_1262693697763”,但在应用中读取彩信 附件时,这个字段基本没什么用,因为不能直接读取这个文件。读取同样要通过ContentProvider,URI为“content://mms /part”,该URI就是对应着part表。可以使用下列代码段来读取文件:
String selection = new String("mid='" + key + "'");//这个key就是pdu里面的_id。
Cursor cur = getContentResolver().query(Uri.parse("content://mms/part"), null, selection, null, null);
if (cur.moveToFirst())
do {
int _partID = cur.getInt(cur.getColumnIndex("_id"));
String partID = String.valueOf(_partID);
Uri partURI = Uri.parse("content://mms/part/" + partID);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
InputStream is = null;
try {
is = getContentResolver().openInputStream(partURI);
byte[] buffer = new byte[256];
int len = is.read(buffer);
while (len >= 0)
{
baos.write(buffer, 0, len);
len = is.read(buffer);
}
} catch (IOException e) {
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
}
}
}
}
这里得到的baos,就是附件文件。
android+查询彩信号码,android 短信 彩信 数据库相关推荐
- Android 截取指定号码的短信 并且不让系统获取短信通知用户
之前在做黑名单屏蔽短信的时候,遇到一个比较棘手的问题,就是我截取我指定号码的短信之后,但是我如何不让系统通过通知栏通知用户,在网上也寻找了很久,也有点眉目了,以下是别人使用 ContentObserv ...
- android获取指定号码的短信,如何接收特定号码的短信信息?
我想接收一个特定号码的信息.当我运行应用程序时,我会从收件箱中的每个人那里收到消息.我从 this site (android authority) package com.nqr.smsapp; i ...
- Android 6.1 短信彩信导入 Android 7.1.1
https://me94.me/3651.html 本方法 Moto X 2014(欧版 XT1092 Android 6.0 MPE24.49-18)升级到 Lineage 14.1(XT1092 ...
- 怎样在Android上手动备份你的短信/彩信?
如果你要换一部手机或升级你的系统,备份你的数据就变得至关重要.我们存储重要数据的位置之一就是我们的短信/彩信,不管是感情价值还是实用价值,备份它们是很有用的. 然而,不像照片.视频或音频文件可以相对容 ...
- 怎样在 Android 上手动备份你的短信/彩信?
导读 如果你要换一部手机或升级你的系统,备份你的数据就变得至关重要.我们存储重要数据的位置之一就是我们的短信/彩信,不管是感情价值还是实用价值,备份它们是很有用的.然而,不像照片.视频或音频文件可以相 ...
- android 自动发彩信,Android编程实现定时发短信功能示例
本文实例讲述了Android编程实现定时发短信功能.分享给大家供大家参考,具体如下: 第一,要实现发短信的功能,必须要用到android系统中发短信的权限,即在AndoridManifest.xml中 ...
- Android 调用系统发短信界面,给指定号码发短信,并带短信内容
工具类如下ContentUtil.java: package com.zhoucj.messagedemo.util; import android.content.Context; import a ...
- Android短信Messaging数据库字段分析
数据库提取 在 Android Studio 中点击 Device File Explorer按钮. 选择/data/data/com.xxx.xxx/databases/bugle_db右键 Sav ...
- Android的基本常用的短信操作
1.调用系统发送短信界面(传入手机号码+短信内容) 2.隐藏发送短信(指定号码指定内容)(这里隐藏只是没有反写入数据库) 3.获得收件箱接收到的短信 4.Android屏蔽新短信通知提示信息:(Con ...
- Android 获取通话记录和短信内容
Android 获取通话记录和短信内容 一.获取通话记录 1.权限声明,需要在Manifest.xml文件中声明权限(读取通话记录权限): <uses-permission android:na ...
最新文章
- 【进阶玩法】Angular用emit()实现类似Vue.js的v-model双向绑定[(ngModel)]功能
- 手撸 webpack4.x 配置(一)
- Rion®-RCMS报表综合管理系统
- c#_未将对象引用设置到对象的实例
- 在Eclipse上搭建Android C开发环境
- Java学习笔记——局部变量和成员变量
- 【定时任务】quartz表达式Cron Expression解析
- good-Windows下搭建PHP开发环境(Apache+PHP+MySQL)
- 【Web前端开发最佳实践系列】前端代码推荐和建议
- H264 profile and level
- CentOS下Apache服务器的安装与配置
- clob字段怎么导出_人人都会遇到的问题:Java 如何优雅的导出 Excel~
- Atitit.mvc的趋势与未来attilax总结
- HighNewTech:19.04.22今天GitHub后无来者大事件之【B站后端代码不小心被开源】
- c语言的if语句案例,c语言if语句(c语言if语句例子)
- js如何区分单击与双击(如何避免双击的时候触发单击事件)
- 中国自动上弦手表市场趋势报告、技术动态创新及市场预测
- Sublime Text的使用代码块安装的模块
- 美团运筹优化实战——智能配送系统阅读笔记
- 如何取消(或关闭)win2003中的ie增强安全配置