Android SMS database summary and analysis

Source: Internet
Author: User
Android SMS database detailed summary and analysis of SMS files/data/COM. Android. providers. telephony/databases/mmssms. DB
The database has 13 tables, and the SMS table contains SMS information.

The URI of the SMS table is

Public static final URI content_uri = URI. parse ("content: // SMS"); table item meaning, I guess
Strcolumnname = _ id strcolumnvalue = 48 // Short Message serial number
Strcolumnname = thread_id strcolumnvalue = 16 // The Conversation sequence number (conversation)
Strcolumnname = address strcolumnvalue = + 8613411884805 // sender address, mobile phone number
Strcolumnname = person strcolumnvalue = NULL // The sender. The returned number is the serial number in the contact list. The stranger is null.
Strcolumnname = date strcolumnvalue = 1256539465022 // Date long type. If you want to convert the date type by yourself!
Strcolumnname = protocol strcolumnvalue = 0 // Protocol
Strcolumnname = read strcolumnvalue = 1 // whether to read
Strcolumnname = status strcolumnvalue =-1 // status
Strcolumnname = type strcolumnvalue = 1 // type 1 is received, and 2 is issued
Strcolumnname = reply_path_present strcolumnvalue = 0 //
Strcolumnname = subject strcolumnvalue = NULL // topic
Strcolumnname = body strcolumnvalue = Hello // Short Message Content
Strcolumnname = service_center strcolumnvalue = + 8613800755500 // Number of the SMS service center, where the text message is sent

Add the source code.
In frameworks/base/CORE/Java/Android/provider/telephony. Java
/*** The thread ID of the Message * <p> type: integer </P> */public static final string thread_id = "thread_id "; /*** the address of the other party * <p> type: Text </P> */public static final string address = "Address "; /*** the person ID of the sender * <p> type: INTEGER (long) </P> */public static final string person_id = "person "; /*** the date the message was sent * <p> type: INTEGER (long) </P> */public static final string date = "date "; /*** the Protocol identifier code * <p> type: integer </P> */public static final string protocol = "protocol "; /*** has the message been read * <p> type: INTEGER (Boolean) </P> */public static final string READ = "read "; /*** the TP-status value for the message, or-1 if no status has * been encrypted ed */public static final string status = "status"; US example: 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 * <p> type: integer </P> */public static final string type = "type "; for example, 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 <code> TP-reply-path </code> bit was set on this message * <p> type: boolean </P> */public static final string reply_path_present = "reply_path_present";/*** the subject of the message, if present * <p> type: text </P> */public static final string subject = "subject";/*** the body of the Message * <p> type: text </P> */public static final string body = "body";/*** the service center (SC) through which to send the message, if present * <p> type: Text </P> */public static final string service_center = "service_center"; reprinted from http://hi.baidu.com/tclc2009/blog/item/63ab71ecca46ab382cf53409.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.