`

Android MMS,SMS之常用Uri

 
阅读更多
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/#

分享到:
评论

相关推荐

    Sms.rar_MMS_android sms_android 短信_sms_sms android

    这个名为"Sms.rar"的压缩包包含了一个关于Android SMS(Short Message Service)功能的源码实现,特别提到了MMS(Multimedia Messaging Service)的支持,这允许发送和接收包含多媒体内容的消息。下面将详细解释这些...

    Android 常用的Intent的URI及示例

    intent.setType("vnd.android-dir/mms-sms"); startActivity(intent); ``` 以上示例仅展示了Android中Intent的URI部分功能,实际上Intent的灵活性远不止于此。掌握这些基本用法,将有助于开发者构建更强大、更智能...

    SMS.rar_android_android sms.zip_sms_sms android_sms java

    通过ContentResolver和Uri,开发者可以直接查询Android的SMS提供者来获取或修改短信数据。例如,`content://sms/inbox`代表收件箱,`content://sms/sent`代表已发送的消息。 6. **SMS Java开发**: `sms_java`...

    Android应用源码之Mms.zip

    - **Content Provider**:提供对MMS和SMS数据的统一访问接口,允许其他应用通过URI查询和修改MMS信息。 - **BroadcastReceiver**:监听系统事件,如网络状态变化、新消息到达等,触发相应操作。 4. **库和框架的...

    Android中Intent的Uri使用

    it.setType("vnd.android-dir/mms-sms"); startActivity(it); ``` 这里,“TheSMStext”是短信的具体内容。 ### 7. 发送带有指定接收者的短信 为了发送一条短信到特定的电话号码,可以采用以下方式: ```java ...

    android4.0.4 MMS原生代码

    在Android 4.0.4中,MMS和SMS的消息记录被存储在一起,但通过不同的URI进行区分。SmsProvider提供了统一的接口,供其他应用访问和操作MMS及SMS数据。 6. **MMS发送流程** 发送MMS时,MmsService首先创建MMS消息...

    Android4.42短信MMs源码

    6. **ContentProvider**: Android的ContentProvider是数据共享的关键组件,Mms源码中包含的MmsProvider用于管理和提供MMS数据的访问接口,其他应用可以通过URI查询或修改MMS信息。 7. **BroadcastReceiver**: 在...

    Android Mms之:深入MMS支持

    由于Mms应用将MMS和SMS视为统一的对话消息,创建MMS只需在作曲家(Composer)界面点击附件菜单,选择媒体类型并添加文件即可。添加完成后,`Composer`会调用`WorkingMessage.setAttachment()`,将Uri转换为`...

    Android应用源码之sms.zip

    "Android应用源码之sms.zip"提供的源码很可能是关于如何在Android系统中处理短信功能的一个示例或学习资源。源码通常包含了完整的类、方法、变量和逻辑,可以帮助开发者深入理解Android SMS API的使用和实现细节。...

    第七章android后台服务_电话服务_SMS_MMS.docx

    ### 第七章 Android 后台服务详解:电话服务、SMS 和 MMS #### Service 技术概述 在 Android 应用开发中,Service 是一种重要的组件,它可以在没有用户界面的情况下运行于后台,执行长时间运行的操作,如播放音乐...

    安卓Android源码——sms1.rar

    在 Android 系统中,短信服务(SMS)是核心功能之一,它允许用户发送、接收和管理文本消息。本文将深入探讨 Android 源码中的短信实现,主要关注 SMS 相关的组件、数据存储以及 API 使用。 1. **短信服务组件**: ...

    android常用的API接口调用

    it.setType("vnd.android-dir/mms-sms"); startActivity(it); ``` 这将打开系统默认的短信应用程序,显示指定的短信内容。 也可以使用 Uri.parse() 方法来解析短信的内容。例如: ```java Uri uri = Uri.parse("sms...

    android常用Intent

    通过`putExtra()`方法将短信文本添加到Intent中,并设置类型为`vnd.android-dir/mms-sms`,然后启动一个活动来展示预填充的短信界面,用户可以在其中进行编辑和发送。 ### 5. 拨打电话 #### 示例代码: ```java ...

    android 短信源码

    在Android系统中,短信服务是核心功能之一,它允许用户收发短信,是人与人之间通信的重要方式。本文将深入解析"android短信源码",主要关注Android系统自带的MMS( Multimedia Messaging Service,多媒体信息服务)...

    android用Intent调用常用的系统组件

    it.setType("vnd.android-dir/mms-sms"); startActivity(it); ``` 7. **发送短信** 使用`ACTION_SENDTO`动作发送短信到指定号码。 ```java Uri uri = Uri.parse("smsto:0800000123"); Intent it = new ...

    android 常用的系统调用

    it.setType("vnd.android-dir/mms-sms"); startActivity(it); ``` 这种方式会打开短信编辑界面,并预填短信内容。 **方法2:** ```java Uri uri = Uri.parse("smsto:0800000123"); // 替换"0800000123"为实际电话...

    android 20个常用的系统调用代码片段

    ### Android 20个常用的系统调用代码片段详解 #### 1. 从Google搜索内容 ```java Intent intent = new Intent(); intent.setAction(Intent.ACTION_WEB_SEARCH); intent.putExtra(SearchManager.QUERY, ...

    安卓Android源码——sms.rar

    在安卓(Android)系统中,短信服务(SMS)是核心组件之一,用于处理手机上的文本消息通信。这个压缩包“安卓Android源码——sms.rar”很可能包含的是Android操作系统内核中与短信服务相关的源代码。深入理解这部分...

    Android Intent调用 Uri的方法总结

    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"); ...

Global site tag (gtag.js) - Google Analytics