日期:2014-05-16  浏览次数:20461 次

Android 短信数据库详细介绍
Android 短信数据库详细总结分析
短信 sms?
文件 /data/data/com.android.providers.telephony/databases/mmssms.db?
这个数据库有13张表,sms表存了短信信息。?

sms表的uri是????????
public ? static ? final ?Uri?CONTENT_URI?=?? ????????????Uri.parse("content://sms" );?
表项含义,我猜的?
strColumnName=_id strColumnValue=48 //短消息序号?
strColumnName=thread_id strColumnValue=16 //对话的序号(conversation)
strColumnName=address strColumnValue=+8613411884805 //发件人地址,手机号
strColumnName=person strColumnValue=null //发件人,返回一个数字就是联系人列表里的序号,陌生人为null
strColumnName=date strColumnValue=1256539465022 //日期 long型,想得到具体日期自己转换吧!
strColumnName=protocol strColumnValue=0 //协议
strColumnName=read strColumnValue=1 //是否阅读
strColumnName=status strColumnValue=-1 //状态
strColumnName=type strColumnValue=1 //类型 1是接收到的,2是发出的
strColumnName=reply_path_present strColumnValue=0 //
strColumnName=subject strColumnValue=null //主题
strColumnName=body strColumnValue=您好 //短消息内容
strColumnName=service_center strColumnValue=+8613800755500 //短信服务中心号码编号,可以得知该短信是从哪里发过来的

把源码补上。?
在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> ? ??*/ ?? ? <