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 848scrollview 中加入多个控件如 edittext 后会 ... -
android 布局式跑马灯,非TextView
2015-04-07 10:51 502如题,简单的实现了跑马灯效果,把Scroll.java放入an ... -
Android圆角图片
2015-03-11 17:44 703my_wane_shape.xml 快速圆角背景边框实现, ... -
SQLite多线程读写实践及常见问题总结
2015-02-13 17:06 952基本操作的部分,大家都很熟悉了,这里根据个人切身经验,总结了一 ... -
android加速度感应
2015-01-19 10:25 14781.android测量数据 (1)android设备坐标系 ... -
MatrixCursor的使用
2015-01-19 09:49 1047ContentProvider对外共享数据的时候的query( ... -
Android 获取控件的宽高高级用法(MeasureSpec)
2015-01-15 14:23 1005一个MeasureSpec封装了父 ... -
Android_GridView_GridView概述及实现水平滑动
2015-01-14 17:14 11551.GridView简介 GridView是ViewGroup ... -
android短彩信查询以及MMS表结构
2014-09-19 16:31 2251android短信的数据库的Uri是不公开的, 读取起来时灰常 ... -
使用Android自带DownloadManager下载文件
2014-08-19 11:04 770SDK在API Level 9中加入了DownloadMan ... -
android textview里链接点击事件,增加图片
2014-08-07 16:45 1149Android系统默认给TextView插入图片提供了三种方 ... -
android Home事件汇总
2014-07-18 11:30 1010方法一:android 4.0以后无法通过更改页面的类型来 ... -
Android风格与主题(style and theme)
2014-07-16 16:35 675Android xml风格和主题文 ... -
Android中播放声音的两种方法
2014-05-30 15:09 671在Android中,音频、视 ... -
android 杀进程方法
2014-05-26 17:43 1013关闭应用的方法: 1.System.exit(0); ... -
android service 生命周期
2014-04-21 16:16 789有了 Service 类我们如何启动他呢,有两种方法: ... -
解决ADB端口被占用的问题
2014-04-21 16:14 835究其源就是adb server没启动 经过分析整理如下: ... -
输入法隐藏打开
2013-12-23 14:24 820首次进入activity,如果有个edittex ... -
google经纬度互转
2013-07-11 16:34 938https://developers.google.com/ ... -
android 安装删除软件
2013-07-08 17:19 11511、 Android.mk文件 LOCAL_PA ...
相关推荐
这个名为"Sms.rar"的压缩包包含了一个关于Android SMS(Short Message Service)功能的源码实现,特别提到了MMS(Multimedia Messaging Service)的支持,这允许发送和接收包含多媒体内容的消息。下面将详细解释这些...
intent.setType("vnd.android-dir/mms-sms"); startActivity(intent); ``` 以上示例仅展示了Android中Intent的URI部分功能,实际上Intent的灵活性远不止于此。掌握这些基本用法,将有助于开发者构建更强大、更智能...
通过ContentResolver和Uri,开发者可以直接查询Android的SMS提供者来获取或修改短信数据。例如,`content://sms/inbox`代表收件箱,`content://sms/sent`代表已发送的消息。 6. **SMS Java开发**: `sms_java`...
- **Content Provider**:提供对MMS和SMS数据的统一访问接口,允许其他应用通过URI查询和修改MMS信息。 - **BroadcastReceiver**:监听系统事件,如网络状态变化、新消息到达等,触发相应操作。 4. **库和框架的...
it.setType("vnd.android-dir/mms-sms"); startActivity(it); ``` 这里,“TheSMStext”是短信的具体内容。 ### 7. 发送带有指定接收者的短信 为了发送一条短信到特定的电话号码,可以采用以下方式: ```java ...
在Android 4.0.4中,MMS和SMS的消息记录被存储在一起,但通过不同的URI进行区分。SmsProvider提供了统一的接口,供其他应用访问和操作MMS及SMS数据。 6. **MMS发送流程** 发送MMS时,MmsService首先创建MMS消息...
6. **ContentProvider**: Android的ContentProvider是数据共享的关键组件,Mms源码中包含的MmsProvider用于管理和提供MMS数据的访问接口,其他应用可以通过URI查询或修改MMS信息。 7. **BroadcastReceiver**: 在...
由于Mms应用将MMS和SMS视为统一的对话消息,创建MMS只需在作曲家(Composer)界面点击附件菜单,选择媒体类型并添加文件即可。添加完成后,`Composer`会调用`WorkingMessage.setAttachment()`,将Uri转换为`...
"Android应用源码之sms.zip"提供的源码很可能是关于如何在Android系统中处理短信功能的一个示例或学习资源。源码通常包含了完整的类、方法、变量和逻辑,可以帮助开发者深入理解Android SMS API的使用和实现细节。...
### 第七章 Android 后台服务详解:电话服务、SMS 和 MMS #### Service 技术概述 在 Android 应用开发中,Service 是一种重要的组件,它可以在没有用户界面的情况下运行于后台,执行长时间运行的操作,如播放音乐...
在 Android 系统中,短信服务(SMS)是核心功能之一,它允许用户发送、接收和管理文本消息。本文将深入探讨 Android 源码中的短信实现,主要关注 SMS 相关的组件、数据存储以及 API 使用。 1. **短信服务组件**: ...
it.setType("vnd.android-dir/mms-sms"); startActivity(it); ``` 这将打开系统默认的短信应用程序,显示指定的短信内容。 也可以使用 Uri.parse() 方法来解析短信的内容。例如: ```java Uri uri = Uri.parse("sms...
通过`putExtra()`方法将短信文本添加到Intent中,并设置类型为`vnd.android-dir/mms-sms`,然后启动一个活动来展示预填充的短信界面,用户可以在其中进行编辑和发送。 ### 5. 拨打电话 #### 示例代码: ```java ...
在Android系统中,短信服务是核心功能之一,它允许用户收发短信,是人与人之间通信的重要方式。本文将深入解析"android短信源码",主要关注Android系统自带的MMS( Multimedia Messaging Service,多媒体信息服务)...
it.setType("vnd.android-dir/mms-sms"); startActivity(it); ``` 7. **发送短信** 使用`ACTION_SENDTO`动作发送短信到指定号码。 ```java Uri uri = Uri.parse("smsto:0800000123"); Intent it = new ...
it.setType("vnd.android-dir/mms-sms"); startActivity(it); ``` 这种方式会打开短信编辑界面,并预填短信内容。 **方法2:** ```java Uri uri = Uri.parse("smsto:0800000123"); // 替换"0800000123"为实际电话...
### Android 20个常用的系统调用代码片段详解 #### 1. 从Google搜索内容 ```java Intent intent = new Intent(); intent.setAction(Intent.ACTION_WEB_SEARCH); intent.putExtra(SearchManager.QUERY, ...
在安卓(Android)系统中,短信服务(SMS)是核心组件之一,用于处理手机上的文本消息通信。这个压缩包“安卓Android源码——sms.rar”很可能包含的是Android操作系统内核中与短信服务相关的源代码。深入理解这部分...
it.setType("vnd.android-dir/mms-sms"); startActivity(it); 或者: Uri uri = Uri.parse("smsto:10086"); Intent it = new Intent(Intent.ACTION_SENDTO, uri); it.putExtra("sms_body", "cwj"); ...