Android 通过彩信以编程方式发送图像(操作超时)
我想在 Android 中以编程方式通过彩信发送图像。我正在关注以下链接:
http:// /androidbridge.blogspot.com/2011/03/how-to-send-mms-programmatically-in.html
它有时有效,但大多数情况下有效我收到“java.net.SocketException:操作超时”。
任何人都可以提供有关此问题的更多信息吗?
I want to send an image via MMS programmatically in Android. I am following the links below:
http://androidbridge.blogspot.com/2011/03/how-to-send-mms-programmatically-in.html
How to send image via MMS in Android?
It works sometimes but mostly I get a "java.net.SocketException: The operation timed out".
Can any one provide more information regarding this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来你真的超时了。您说它有时有效...您所在地区的 3G(或您正在使用的任何设备)数据网络是否存在接收问题?
如果您从同一位置上网并且页面没有加载刷新和超时,那么这可能就是您的问题。
尝试一下您知道接收效果好的地方。您可以通过捕获异常并在向用户弹出消息无法发送等消息之前重试消息发送几次来绕过此问题。更好的是保存未发送消息的历史记录,以便用户稍后可以重新发送它们。当然,我假设消息的发送是用户驱动的。如果没有,您可以不时(每隔几分钟)检查数据接收情况,然后在足够好的情况下重新发送,直到通过为止。
希望我有所帮助。
Sounds like you are really having a timeout. You say it sometimes works... Do you have a reception problem with your 3G (or whatever you are using) data network in your area?
If you are surfing the internet from the same location and pages don't load refresh and timeout, then that's probably your problem.
Try where you know the reception is good. You can bypass this problem by catching the exception and retry the sending of the message a few more times before popping a message to the user that the message could not be sent or the such. Better yet would be to save a history of unsent messages so that the user can resend them later. Of course I am assuming that the sending of the message is user driven. If not, you could check the data reception from time to time (every few minutes) and then resend when good enough until it goes through.
Hope that I helped.
MMS 只是使用额外网络发送的 HTTP-POST 请求
MMS is just a htttp-post request send using extra network