安卓:发送短信(通过发件箱) [英] Android : Sending an SMS (using the Outbox)

查看:107
本文介绍了安卓:发送短信(通过发件箱)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的短信应用程序为Android,这无疑需要发送的短信(去图;!)

现在,我知道有很多的描述使用SmsManager的发送短信息在网络上的来源。但是,很显然,使用该方法时,短信息不存储在已发送文件夹.. 。其中是一种对短信应用程序的基本要求。

我如何添加一个条目(的消息)进入发件箱,以便它能够发送(或存储在发送文件夹自动).... 什么是字段的值_id,主题ID,读,状态,类型,service_center(消息表的属性)??

任何其他的替代品也欢迎。 :) 在此先感谢...

解决方案
  

但是,很显然,当使用该   的方法,该短信息未存储在   已发送文件夹......这是怎样的   对于短信的基本要求   应用程序。

一个已发送文件夹的概念是一个应用,而不是操作系统的特征。如果你想创建自己的SMS客户端应用程序,创建自己的已发送文件夹中的应用程序的功能。你知道你要发送什么信息,这样你就可以将它们存储你喜欢的地方(例如,SQLite数据库)。

如果你想发送短信,并让它们出现在用户选择的SMS客户端的已发送文件夹,请不要使用 SmsManager的。相反,使用 ACTION_SENDTO ,并在消息由用户选择的SMS客户端发送,如证明的此示例项目

I'm working on an SMS Application for Android, which undoubtedly needs to send SMSes (go figure! ;)

Now, i know there are a plenty of sources on the net that describe using the SmsManager to send SMSes...But, apparently, when using that method, the SMSes aren't stored in the "SENT" Folder...which is kind of a basic requirement for an SMS application.

How do i add an entry (of a message) into the "Outbox", so that it gets sent (and stored in the SENT Folder Automatically).... What would be the Values of the fields "_id,threadid,read,status,type,service_center" (Attributes of the message table)??

Any other alternatives are also welcome. :) Thanks in Advance...

解决方案

But, apparently, when using that method, the SMSes aren't stored in the "SENT" Folder...which is kind of a basic requirement for an SMS application.

The concept of a "SENT" folder is a feature of an application, not the operating system. If you wish to create your own SMS client application, create your own "SENT" folder as a feature of that application. You know what messages you are sending, so you can store them wherever you like (e.g., SQLite database).

If you want to send SMS messages and have them appear in the "SENT" folder of the user's chosen SMS client, don't use SmsManager. Instead, use ACTION_SENDTO and have the message be sent by the user's chosen SMS client, as is demonstrated by this sample project.

这篇关于安卓:发送短信(通过发件箱)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆