Android MMS,SMS之常用Uri

转载 2012年03月30日 12:45:01

Android提供了很多查询系统数据的Uri,这里是一些关于MMS,SMS常用的Uri以及对其的一些分析

Uri:

content://sms

sql语句:

SELECT * FROM sms WHERE ({where}) ORDER BY date DESC

可用列:

_id:thread_id:address:person:date:protocol:read:status:type:reply_path_present:

subject:body:service_center:locked:error_code:seen:

 

Uri:

content://mms

sql语句:

SELECT * FROM pdu WHERE ({where}) ORDER BY date DESC

可用列:

_id:thread_id:date:msg_box:read:m_id:sub:sub_cs:ct_t:ct_l:exp:m_cls:m_type:

v:m_size:pri:rr:rpt_a:resp_st:st:tr_id:retr_st:retr_txt:retr_txt_cs:read_status:ct_cls:

resp_txt:d_tm:d_rpt:locked:seen:

 

Uri:

content://mms/threads (selection须为null)

sql语句:

SELECT * FROM pdu group by thread_id

可用列:

_id:thread_id:date:msg_box:read:m_id:sub:sub_cs:ct_t:ct_l:exp:m_cls:m_type:

v:m_size:pri:rr:rpt_a:resp_st:st:tr_id:retr_st:retr_txt:retr_txt_cs:read_status:ct_cls:

resp_txt:d_tm:d_rpt:locked:seen:

 

Uri:

content://mms/{id}/part (id为pdu表_id,part表mid,pending_msgs表msg_id)

sql语句:

SELECT * FROM part WHERE (mid={id}) AND ({where}) ORDER BY seq

可用列:

_id:mid:seq:ct:name:chset:cd:fn:cid:cl:ctt_s:ctt_t:_data:text:

 

Uri:

content://mms/part/{id} (id为part表的_id)

sql语句:

SELECT * FROM part WHERE (_id={id}) AND ({where}) ORDER BY seq

可用列:

_id:mid:seq:ct:name:chset:cd:fn:cid:cl:ctt_s:ctt_t:_data:text:

 

Uri:

content://mms/{id}/addr (id为pdu表_id,part表mid,pending_msgs表msg_id)

sql语句:

SELECT * FROM addr WHERE (msg_id={id}) AND ({where})

可用列:

_id:msg_id:contact_id:address:type:charset:

 

Uri:

content://mms-sms/complete-conversations (projection必须指定可用列,否则该列返回null)

sql语句:

SELECT {projection} FROM (SELECT DISTINCT date * 1 AS normalized_date, {projection} FROM sms WHERE ({where}) AND (type != 3)) UNION SELECT DISTINCT date * 1000 AS normalized_date, {projection} FROM pdu LEFT JOIN pending_msgs ON pdu._id = pending_msgs.msg_id WHERE ({where}) AND msg_box != 3 AND (msg_box != 3 AND (m_type = 128 OR m_type = 132 OR m_type = 130))) ORDER BY normalized_date ASC)

可用列:

一切sms,pdu,pending_msgs中的列均可用,不存在则返回null

 

Uri:

content://mms-sms/conversations (同上)

sql语句:

SELECT {projection} FROM (SELECT thread_id AS tid, date * 1000 AS normalized_date, NULL AS body, NULL AS person, sub, NULL AS subject, retr_st, NULL AS type, date, ct_cls, sub_cs, _id, read, ct_l, tr_id, st, msg_box, thread_id, NULL AS reply_path_present, m_cls, read_status, ct_t, NULL AS status, retr_txt_cs, d_rpt, NULL AS error_code, m_id, m_type, v, exp, pri, NULL AS service_center, NULL AS address, rr, rpt_a, resp_txt, locked, resp_st, m_size FROM pdu WHERE ({where}) AND (msg_box != 3 AND (m_type = 128 OR m_type = 132 OR m_type = 130))) GROUP BY thread_id HAVING date = MAX(date) UNION SELECT thread_id AS tid, date * 1 AS normalized_date, body, person, NULL AS sub, subject, NULL AS retr_st, type, date, NULL AS ct_cls, NULL AS sub_cs, _id, read, NULL AS ct_l, NULL AS tr_id, NULL AS st, NULL AS msg_box, thread_id, reply_path_present, NULL AS m_cls, NULL AS read_status, NULL AS ct_t, status, NULL AS retr_txt_cs, NULL AS d_rpt, error_code, NULL AS m_id, NULL AS m_type, NULL AS v, NULL AS exp, NULL AS pri, service_center, address, NULL AS rr, NULL AS rpt_a, NULL AS resp_txt, locked, NULL AS resp_st, NULL AS m_size FROM sms WHERE ({where}) AND (type != 3)) GROUP BY thread_id HAVING date = MAX(date)) GROUP BY tid HAVING normalized_date = MAX(normalized_date)

可用列:

同上

 

content://mms-sms/conversations/{threadID} (threadID为sms表的thread_id,pdu表的_id,pending_msgs表的msg_id,part表的mid)

sql语句:

SELECT {projection} FROM (SELECT DISTINCT date * 1 AS normalized_date, {projection} FROM sms WHERE ({where}) AND thread_id = {thread_id} AND (type != 3)) UNION SELECT DISTINCT date * 1000 AS normalized_date, pdu._id, NULL AS body FROM pdu LEFT JOIN pending_msgs ON pdu._id = pending_msgs.msg_id WHERE ({where}) AND thread_id = {thread_id} AND msg_box != 3 AND (msg_box != 3 AND (m_type = 128 OR m_type = 132 OR m_type = 130))) ORDER BY normalized_date ASC)

同上

 

以下是Android提供的关于MMS,SMS的各种Uri

content://sms

 

content://sms/#

 

content://sms/inbox

 

content://sms/inbox/#

 

content://sms/sent

 

content://sms/sent/#

 

content://sms/draft

 

content://sms/draft/#

 

content://sms/outbox

 

content://sms/outbox/#

 

content://sms/undelivered

 

content://sms/failed

 

content://sms/failed/#

 

content://sms/queued

 

content://sms/conversations

 

content://sms/conversations/*

 

content://sms/raw

 

content://sms/attachments

 

content://sms/attachments/#

 

content://sms/threadID

 

content://sms/threadID/*

 

content://sms/status/#

 

content://sms/sr_pending

 

content://sms/icc

 

content://sms/icc/#

 

content://sms/sim

 

content://sms/sim/#

 

content://mms

 

content://mms/#

 

content://mms/inbox

 

content://mms/inbox/#

 

content://mms/sent

 

content://mms/sent/#

 

content://mms/drafts

 

content://mms/drafts/#

 

content://mms/outbox

 

content://mms/outbox/#

 

content://mms/part

 

content://mms/#/part

 

content://mms/part/#

 

content://mms/#/addr

 

content://mms/rate

 

content://mms/report-status/#

 

content://mms/report-request/#

 

content://mms/drm

 

content://mms/drm/#

 

content://mms/threads

 

content://mms/scrapSpace

 

content://mms-sms/conversations

 

content://mms-sms/complete-conversations

 

// In these patterns, “#” is the thread ID.

 

content://mms-sms/conversations/#

 

content://mms-sms/conversations/#/recipients

 

content://mms-sms/conversations/#/subject

 

// URI for deleting obsolete threads.

 

content://mms-sms/conversations/obsolete”, URI_OBSOLETE_THREADS);

 

content://mms-sms/messages/byphone/*

 

// In this pattern, two query parameter names are expected:

 

// “subject” and “recipient.” Multiple “recipient” parameters

 

// may be present.

 

content://mms-sms/threadID

 

// Use this pattern to query the canonical address by given ID.

 

content://mms-sms/canonical-address/#

 

// Use this pattern to query all canonical addresses.

 

content://mms-sms/canonical-addresses

 

content://mms-sms/search

 

// In this pattern, two query parameters may be supplied:

 

// “protocol” and “message.” For example:

 

// content://mms-sms/pending?

 

// -> Return all pending messages;

 

// content://mms-sms/pending?protocol=sms

 

// -> Only return pending SMs;

 

// content://mms-sms/pending?protocol=mms&message=1

 

// -> Return the the pending MM which ID equals ’1′.

 

//

 

content://mms-sms/pending

 

// Use this pattern to get a list of undelivered messages.

 

content://mms-sms/undelivered

 

// Use this pattern to see what delivery status reports (for

 

// both MMS and SMS) have not been delivered to the user.

 

content://mms-sms/notifications

 

content://mms-sms/draft

 

content://mms-sms/locked

 

content://mms-sms/locked/#


Android MMS,SMS之常用Uri

Android MMS,SMS之常用Uri 轉載原文: http://labs.ywlx.net/?p=899 這是從網路上找到的一份資料,挺實用的,記錄並轉載於此。 And...
  • gordonyui
  • gordonyui
  • 2011年12月13日 10:30
  • 1278

SMS/MMS发送逻辑

Android 7对自己的Messaging 做了比较多的改动,去除了之前的transaction文件夹等,个人大概看了,基本进行了一次重构,把发送MMS/SMS的数据处理放到了datamodel文件...
  • u011834943
  • u011834943
  • 2017年01月13日 01:15
  • 696

Android 源码阅读之SMS,MMS

现在读彩信,从sendMmsWork开始: com.android.mms.data.WorkingMessage.java sendMmsWorker -> MmsMessageSender.s...
  • huangyabin001
  • huangyabin001
  • 2014年06月07日 17:18
  • 1315

发送SMS与MMS过程

pending_msgs表: proto_type:0代表sms,1代表mms。 msg_id     :代表pdu表的id msg_type : 128代表等待发送的信息,130代表失败后等待...
  • liu149339750
  • liu149339750
  • 2016年02月29日 18:58
  • 1497

SMS-MMS的草稿箱

1.草稿箱---存储。(ComposeMessageActivity)(type=3) onKeyDown方法的case KeyEvent.KEYCODE_BACK:调用了exitComposeMes...
  • liu149339750
  • liu149339750
  • 2016年02月29日 18:58
  • 557

SMS-MMS加载列表显示

程序读取数据库中短彩信后用ListView来显示信息,所显示用的适配器为MessageListAdapter。 在适配器的bindView方法中构建MessageItem对象,此对象存储了cursor...
  • liu149339750
  • liu149339750
  • 2016年03月03日 10:49
  • 592

MMS 原理及MMS over IMS

1、基本原理 彩信是用来实现彩色视频传送,它最大的特色就是支持多媒体功能,能够传递文字、图像、声音、数据等各种多媒体格式的信息。实际上,彩信和短消息没有任何关系,它是在GPRS网络的支持下,以无线应...
  • huqingwang
  • huqingwang
  • 2012年10月31日 16:04
  • 1120

Android 短信模块分析(七) MMS数据库定义及结构整理

1.7.1 mmssms.db 数据库mmssms.db中表的定义见表4.1至4.18所示: 表4.1 addr(彩信地址) 字段名 类型 描述 备注 _id I...
  • t12x3456
  • t12x3456
  • 2013年07月19日 09:04
  • 13082

关于MMS,SMS常用的Uri

转自http://www.cnblogs.com/kakafra/archive/2012/10/06/2713327.html   Android提供了很多查询系统数据的Uri,这里是一些关于...
  • u010037124
  • u010037124
  • 2014年08月10日 11:26
  • 579

Android Mms专题之:Compose详解

Mms中的ComposeMessageActivity(以下简称Composer)是整个Mms中最重要的一个组件,它负责编辑信息,发送信息,管理信息,接收信息,与外部应用接口。在Mms内部与Compo...
  • hitlion2008
  • hitlion2008
  • 2012年03月28日 21:33
  • 7843
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Android MMS,SMS之常用Uri
举报原因:
原因补充:

(最多只允许输入30个字)