你可以使用SMS ManagersendDataMessage方法来发送二进制数据。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);

相关文章:

  • 2021-05-20
  • 2022-03-02
  • 2022-02-11
  • 2021-10-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
  • 2021-10-30
相关资源
相似解决方案