Android 短信数据库重要table字段解释

短信数据存储在
/data/user_de/0/com.android.providers.telephony/databases/mmssms.db(7.0及8.0)
短信的主要涉及表格有两个pdu和sms表格
1.pdu表

        `_id`   INTEGER  Pdu id
    `thread_id` INTEGER,  thread id
    `date`  INTEGER,  发送/接收短信的时间(long)
    `date_sent` INTEGER DEFAULT 0,  没有说明
    `msg_box`   INTEGER, 短信存储在哪一个msg box(0 all,1 inbox,2 outbox,3 draft,4 pending)
    `read`  INTEGER DEFAULT 0,  已读或未读(0/1)
    `m_id`  TEXT,  msg id
    `sub`   TEXT,  短信的主题
    `sub_cs`    INTEGER,  charset of the subject(通常是106)
    `ct_t`  TEXT,  content type,for the smil file(application/vnd.wap.multupart.mixed application/vnd.wap.multupart.related)
    `ct_l`  TEXT,  the url indicate the server location which include in the mms when the notification is arrived(can be null)
    `exp`   INTEGER, 彩信有效期 long
    `m_cls` TEXT,  彩信class类型  128:personal 129:advertise 130:information 131:auto 
    `m_type`    INTEGER,  PDU类型
    `v` INTEGER,  mms版本
    `m_size`    INTEGER, 彩信大小
    `pri`   INTEGER,  优先级 128:低 129:通常级别 130:高
    `rr`    INTEGER,  是否需要read report
    `rpt_a` INTEGER,  是否允许read report
    `resp_st`   INTEGER,  response status 128:OK 129:err_unspecified 130:svr_deny
    `st`    INTEGER,  mms的status
    `tr_id` TEXT,  transaction id,for transaction control
    `retr_st`   INTEGER,  Retrieve status 128:OK 192:transient_failure 193:msg not found 194:网络问题
    `retr_txt`  TEXT,  retrieved txt file
    `retr_txt_cs`   INTEGER,  retrieved txt charset
    `read_status`   INTEGER,  read status(read report)  128:read 129:没有读就删了
    `ct_cls`    INTEGER,  content type class
    `resp_txt`  TEXT,  reply txt content
    `d_tm`  INTEGER,  报告时间(report time)
    `d_rpt` INTEGER,  status report
    `locked`    INTEGER DEFAULT 0,  locked or not
    `sub_id`    INTEGER DEFAULT -1, sim card id 默认-1; if gemini the value is >=1
    `seen`  INTEGER DEFAULT 0,  seen or not,Ex.Status report
    `creator`   TEXT,
    `text_only` INTEGER DEFAULT 0

sms表

CREATE TABLE `sms` (
    `_id`   INTEGER,  //sms id
    `thread_id` INTEGER,  //thread table id
    `address`   TEXT, //sender address
    `person`    INTEGER,//如果号码在联系人中,这是一串数字,否则是null
    `date`  INTEGER,  // 
    `date_sent` INTEGER DEFAULT 0, //
    `protocol`  INTEGER,  //sms协议
    `read`  INTEGER DEFAULT 0, //read or not
    `status`    INTEGER DEFAULT -1, // delivery report status
    `type`  INTEGER,  //which box the mms is stored
    `reply_path_present`    INTEGER, //reply path(0)
    `subject`   TEXT,  //主题
    `body`  TEXT,  //短信内容
    `service_center`    TEXT, //服务中心号码
    `locked`    INTEGER DEFAULT 0,  //locked or not
    `sub_id`    INTEGER DEFAULT -1,  //sim id
    `error_code`    INTEGER DEFAULT 0, //error code
    `creator`   TEXT,  //
    `seen`  INTEGER DEFAULT 0,  //seen or not
    `priority`  INTEGER DEFAULT -1, //
    PRIMARY KEY(_id)
);

猜你喜欢

转载自blog.csdn.net/u011109881/article/details/79382909