Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

19.3 Sending Binary Messages

The payload of an SMS message can carry binary data. You will need a BinaryMessage instead of a TextMessage, but the basic procedure is the same.

public void sendBinary(String address, byte[] data)
    throws IOException, InterruptedException {
  String cs = "sms://" + address + ":50001";
  MessageConnection mc = (MessageConnection)
  BinaryMessage bm = (BinaryMessage)

Remember, you've only got 152 bytes in a message, although longer payloads will be split into multiple messages.

  • + Share This
  • 🔖 Save To Your Account