发送数据消息
2009-10-22 22:38
337 查看
你可以使用SMS Manager的sendDataMessage方法来发送二进制数据。sendDataMessage方法很像sendTextMessage,但包含额外的参数——目标端口和你要发送数据的字节数组。
接下来的框架代码显示了发送一个数据消息的基本结构:
Intent sentIntent = new Intent(SENT_SMS_ACTION);
PendingIntent sentPI = PendingIntent.getBroadcast(getApplicationContext(),0,sentIntent,0);
short destinationPort = 80;
byte[] data = [ … your data … ];
smsManager.sendDataMessage(sendTo, null, destinationPort, data, sentPI, null);
接下来的框架代码显示了发送一个数据消息的基本结构:
Intent sentIntent = new Intent(SENT_SMS_ACTION);
PendingIntent sentPI = PendingIntent.getBroadcast(getApplicationContext(),0,sentIntent,0);
short destinationPort = 80;
byte[] data = [ … your data … ];
smsManager.sendDataMessage(sendTo, null, destinationPort, data, sentPI, null);
相关文章推荐
- QT中用udp客户端发送消息,丢失数据的情况以及处理!
- Zstack协议栈OSAL中添加任务事件消息、发送数据详细过程
- 启动任务StartTask() 发送完消息队列 自己删除,接收方一直显示数据 用OSQFlush(Str_Q); //清空消息队列 下面纠结接收不到了 哈哈
- HTML5支持服务器发送事件(Server-Sent Events)-单向消息传递数据推送(C#示例)
- 发送数据消息
- 使用消息队列 异步插入数据,能发送消息,但是无法读取消息
- VC/MFC 不同进程间的消息通信与数据(字符串)发送
- 跨进程消息以及数据发送
- vc如何自定义消息与在线程中向主窗体控件发送数据
- MFC如何自定义消息与在线程中向主窗体控件发送数据
- 通过消息跨进程发送与接收 TCopyDataStruct 数据 - 回复 "skymesh"
- 微信通过openID发送消息/后台post、get提交并接收数据
- SQL Server 2008 表数据改变后发送消息(.net 扩展函数法【稳定】【简洁】)
- 关于winsock中网络编程事件模型和窗口消息模型中FD_WRITE的理解与数据的发送需要注意的关键点
- 关于ajax局部刷新,从数据库实时更新数据到页面(一般是下订单成功后发送消息到后台)
- 通过消息跨进程发送与接收 TCopyDataStruct 数据 - 回复 "skymesh"
- 2017微信数据报告 截至9月日登录用户超9亿日发送消息380亿次
- 跨进程发送消息数据(发送WM_COPYDATA消息,够简单的)
- VC/MFC 不同进程间的消息通信与数据(字符串)发送
- 在 TCP 网络上检测出有重复名称,发送消息的计算机的 IP 地址在数据中