Android MMS,SMS之常用Uri
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提供了很多查询系统数据的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/#
发表评论
-
ScrollView嵌套Edittext
2015-04-08 18:26 788scrollview 中加入多个控件如 edittext 后会 ... -
android 布局式跑马灯,非TextView
2015-04-07 10:51 450如题,简单的实现了跑马灯效果,把Scroll.java放入an ... -
Android圆角图片
2015-03-11 17:44 649my_wane_shape.xml 快速圆角背景边框实现, ... -
SQLite多线程读写实践及常见问题总结
2015-02-13 17:06 900基本操作的部分,大家都很熟悉了,这里根据个人切身经验,总结了一 ... -
android加速度感应
2015-01-19 10:25 14341.android测量数据 (1)android设备坐标系 ... -
MatrixCursor的使用
2015-01-19 09:49 1013ContentProvider对外共享数据的时候的query( ... -
Android 获取控件的宽高高级用法(MeasureSpec)
2015-01-15 14:23 937一个MeasureSpec封装了父 ... -
Android_GridView_GridView概述及实现水平滑动
2015-01-14 17:14 11161.GridView简介 GridView是ViewGroup ... -
android短彩信查询以及MMS表结构
2014-09-19 16:31 2103android短信的数据库的Uri是不公开的, 读取起来时灰常 ... -
使用Android自带DownloadManager下载文件
2014-08-19 11:04 733SDK在API Level 9中加入了DownloadMan ... -
android textview里链接点击事件,增加图片
2014-08-07 16:45 1101Android系统默认给TextView插入图片提供了三种方 ... -
android Home事件汇总
2014-07-18 11:30 963方法一:android 4.0以后无法通过更改页面的类型来 ... -
Android风格与主题(style and theme)
2014-07-16 16:35 637Android xml风格和主题文 ... -
Android中播放声音的两种方法
2014-05-30 15:09 607在Android中,音频、视 ... -
android 杀进程方法
2014-05-26 17:43 972关闭应用的方法: 1.System.exit(0); ... -
android service 生命周期
2014-04-21 16:16 737有了 Service 类我们如何启动他呢,有两种方法: ... -
解决ADB端口被占用的问题
2014-04-21 16:14 783究其源就是adb server没启动 经过分析整理如下: ... -
输入法隐藏打开
2013-12-23 14:24 765首次进入activity,如果有个edittex ... -
google经纬度互转
2013-07-11 16:34 894https://developers.google.com/ ... -
android 安装删除软件
2013-07-08 17:19 11111、 Android.mk文件 LOCAL_PA ...
相关推荐
Android 常用的Intent的URI及示例 很全很强大
可以快速查找android.provider包中所有类的中的URI里面的详细内容,当进入详细内容时 内容没有完全显示时 你可以点击列进行展开 你也可以单击你想看的那行内容 查看那一行的具体信息
android:scheme 通过uri跳转到APP应用指定Activity
最近在工作的过程中,遇到不同 Android 版本下 URI 采用不同方式来获取文件路径的问题。 因为需求的原因,要求拍照上传或者从相册中选择图片上传,而且图片是需要经过压缩的,大小不能超过2M。 很快,拍照的这部分...
Android识别TextView的Uri并在自己的应用程序中打开
感觉Uri 、File、bitmap 比较混乱,这里进行记载,方便以后查看.下面话不多说了,来一起看看详细的介绍吧 Bitmap、File与Uri 1、将一个文件路径path转换成File String path ; File file = new File(path) 2...
android uri的一些理解资料,比较全面的关于uri的解释,可作参考。
Uri转Path
Android系统的音乐应用可以获取到音乐URI,然后通过AIDL传给此后台服务,后台服务把URI解析成字节数组,然后再通过socket传给服务端以显示图片数据。
android 根据uri获取真实路径
androdi ContentProvider和Uri详解
Delphi-XE5-开发 Android URI简介
URI Differ Simple lib to find diffs between URI and represent it in pretty way. Quick start: Use maven: ru.lanwen.diff uri-differ-lib 1.3.0 Add some code: Get changes: UriDiff changes = ...
Android中Uri和Path之间的转换 原因 调用系统拍照应用,拍照后要保存图片,那么我们需要指定一个存储图片路径的Uri。这就涉及到如何将file path转换为Uri。有时候我们还需要根据照片的路径得到照片的media Uri,那么...
本文件介绍的是Anroid中Intent的使用方法,从谷歌中搜索内容;浏览网页;显示地图;路径规划;拨打电话;发送短信等简单功能实现
之所以要用到provider,是因为从Android7.0开始,就不允许在 App 间,使用 file:// 的方式,传递一个 File ,否则就会抛出异常,而provider的作用恰好就是用过 content://的模式替换掉 file://,看上去只是换了个...
ionic cordova 导航插件,URI方式调用高德和百度APP,支持Android和ios
通过Restful的uri完成Activity和Fragment的跳转
本篇文章主要介绍了Android学习笔记之ContentProvider和Uri详解,对于学习Android的朋友具有一定的参考价值,有需要可以可以了解一下。