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>
*/
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"
;
us 举例:
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"
;
举例
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"
;
分享到:
相关推荐
Android 短信数据库 开发资料,请参考我的博客!
在android当中动态的监听知信数据库是否有变化
该app用于将误删除的短信恢复。以txt的形式保存在手机里
主要介绍了Android实现将已发送的短信写入短信数据库的方法,是Android手机开发常见的技巧,需要的朋友可以参考下
android系统常用数据库,拥有联系人、短信、多媒体、设置、启动、日历等系统常用数据库,可以下载来看看这些数据库的表接口,有助于android开发
小例子 涉及短信发送 数据库操作 listview checkbox 等
传智播客_Andorid_20天精通Android开发视频_第13天视频_视频_06_通过内容解析者访问短信数据库.avi
android系统内置数据库字段描述,方便android开发者了解系统数据库结构,各自段的表示(属性),快速来、开发android应用。
主要介绍了Android黑科技之读取用户短信+修改系统短信数据库 的相关资料,需要的朋友可以参考下
短信数据库表名(_id integer 唯一标识,自增,从1开始 date integer 会话最新更新时间 message_count integer 当前会话所包含的消息数量 recipient_ids text 接收者(canonical_addresses表的id)列表,所有接收者...
android手机提取短信,sqlite3数据库开发源码
android 短信群发 将数据保存到数据库 与单发短信区分。
获取短信内容(最新一条短信),根据需要自行修改,详解参见我的博客http://blog.csdn.net/daogepiqian
Android 短信拦截器!包含代码。 环境:android 4.0.3
Android上监听收到的短信(SMS) 方式一:通过广播监听短信消息 方式二:通过短信数据库获取短信内容
android 插入彩信数据库代码 新建彩信 导入彩信
获取短信,从本地数据库或SIM卡匹配发件人的姓名 android获取短信并匹配姓名 android获取短信并匹配姓名
android给自己发假短信 说白了就是通过短信的content provider给短信数据库中写入一条记录 然后显示到短信界面