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 telephony MMS 学习笔记

本文主要从以下几个方面来学习MMS在android系统中的处理:MMS初始化、MMS发送、MMS接收(包括push MMS接收和从MMSC中提取MMS内容)、MMS存储/删除等数据操作。 Andro...
  • tjy1985
  • tjy1985
  • 2012年02月02日 13:58
  • 13906

操作Android中联系人,通话记录,短息,的URI-项海涛

记住读取联系人需要配置权限: 读取联系人的URI:/** * 所有联系人的查询语句 * cota...

关于MMS,SMS常用的Uri

转自http://www.cnblogs.com/kakafra/archive/2012/10/06/2713327.html   Android提供了很多查询系统数据的Uri,这里是一些关于...

吐槽:华为手机的搜索短信问题

好久没更新博客了,最近都在忙公司的短信项目,等过段时间空闲下来,再好好整理下短信相关的内容。这两天,被测试同事的华为荣耀8搞得焦头烂额,在其他手机能正常使用的Uri,在它身上却问题多多,不得不去吐槽国...
  • hyq912
  • hyq912
  • 2017年09月01日 16:13
  • 283

android 短信验证码自动填写的两种方式

实际应用开发中,会经常用到短信验证的功能,这个时候如果再让用户就查看短信.然后再回到界面进行短信的填写,难免有多少有些不方便,作为开发者.本着用户至上的原则我们也应该来实现验证码的自动填写功能,实现短...

Android MMS,SMS之常用Uri

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

android 信息(mms)的故事(四) -- sms解码的实例

这是独立的一节,关于短信sms解码的一些实际例子,包括收到的短信、发送的短信和短信的状态,网络上的例子比较分散,整理在此以备查找。同时关于短信编解码的官方文档当然是 3gpp的相关文档了,关于短信请参...

android中Mms学习笔记——短信(sms)发送流程(二)

在笔记一中的WorkingMessage.send()方法中已经对sms和mms的处理有了区别,他们都开器自己各自的线程进后续的发送工作,接下来针对sms和mms做不同的处理。 一.首先进入preS...

Android 常用的Intent的URI及示例

  • 2011年06月20日 13:19
  • 26KB
  • 下载

MMS/SMS 入口

在MMS中最重要的两个ui,或者说是用户操作短信的入口,一个是conversationList(短信列表界面) ,另一个就是ComposeMessageActiity(单个对话或者短信),以后简称CM...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Android MMS,SMS之常用Uri
举报原因:
原因补充:

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