Android 彩信示例

发布于 2024-11-25 23:48:47 字数 316 浏览 3 评论 0 原文

我尝试遵循这个答案关于通过代码发送彩信。

然而,当他开始谈论 BroadCastReciversAndroid git 并且没有提供代码时,我停了下来。我真的对此迷失了。一开始很简单,但后来就变得很复杂。

任何人都可以解释该答案中缺少的代码或提供它(如果存在)吗?

多谢

I tried to follow this answer about sending MMS through code.

However, I stopped when he start talking about BroadCastRecivers and Android git and not providing the code. I really get lost with this. It was very straight at the beginning but it becomes so complicated after that.

Can any one explain the missing code in that answer or provide it if it is exist ?

Thanks a lot

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

烙印 2024-12-02 23:48:47

对于那些可能感兴趣的人:

MMS 功能是 Android 中有点不可靠且没有详细记录的功能。因此,现有的解决方案并不总是有效。你还不能依赖他们。

To those who might be interested:

MMS Functionality is a bit unreliable, not well-documented feature in Android. So, the existed solutions will not work always. You can't depend on them, yet.

慢慢从新开始 2024-12-02 23:48:47

为了在 Android 上发送彩信,您可以选择使用商业彩信 SDK,而不是使用内部堆栈。

Winwap 此处提供了一个可以让您通过简单的功能发送和接收彩信的功能,例如他们文档中的发送示例:

1. Initialize the API by calling the mmss_init function
2. Connect to the HTTP Proxy or WAP Gateway using the mmss_connect function
3. Create MMS message of type SEND_REQUEST_TYPE by calling mms_message_create function
4. Add MMS headers using mms_set_header_str, mms_set_header_encstr or mms_set_header_long functions. Mandatory headers TRANSACTION_ID, FROM and CONTENT_TYPE shall be set. Also at least one of the headers TO, CC or BCC shall be set. Other headers suitable for this type of message are optional
5. Add content to MMS Message by the help of mms_add_content function
6. Call the mmss_send_message function
7. Destroy MMS message using mms_message_destroy function
8. Disconnect from the HTTP Proxy or WAP Gateway using the mmss_disconnect function
9. Finalize the API by calling the mmss_fini function

缺点是,它是一个商业产品,不能免费提供。

In order to send MMS on Android, you can alternatively use a commercial MMS SDK instead of using the internal stack.

There's one from Winwap here that let's you send and receive MMS messages with simple functions, like the send-example from their docs:

1. Initialize the API by calling the mmss_init function
2. Connect to the HTTP Proxy or WAP Gateway using the mmss_connect function
3. Create MMS message of type SEND_REQUEST_TYPE by calling mms_message_create function
4. Add MMS headers using mms_set_header_str, mms_set_header_encstr or mms_set_header_long functions. Mandatory headers TRANSACTION_ID, FROM and CONTENT_TYPE shall be set. Also at least one of the headers TO, CC or BCC shall be set. Other headers suitable for this type of message are optional
5. Add content to MMS Message by the help of mms_add_content function
6. Call the mmss_send_message function
7. Destroy MMS message using mms_message_destroy function
8. Disconnect from the HTTP Proxy or WAP Gateway using the mmss_disconnect function
9. Finalize the API by calling the mmss_fini function

The downside is, it's a commercial product not available for free.

长安忆 2024-12-02 23:48:47

我没有解决此类问题的经验,但也许这会对您有所帮助:

Intent sendIntent = new Intent(Intent.ACTION_SEND);    
sendIntent.putExtra("sms_body", "some text");    
String url = "\\sdcard\\potrait.PNG";   
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));   
sendIntent.setType("image/png");    
startActivity(sendIntent);

这是来自 此处

这是另一个示例。

I do not have experience in this type of problem but maybe this will help you out a bit:

Intent sendIntent = new Intent(Intent.ACTION_SEND);    
sendIntent.putExtra("sms_body", "some text");    
String url = "\\sdcard\\potrait.PNG";   
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));   
sendIntent.setType("image/png");    
startActivity(sendIntent);

This is a copy from here.

This is another example.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文