SmsManager SendDataMessage on Android

I used the Android SmsManager sendDataMessage Android API to send SMS messages and noticed that the behavior seems to be changing from different devices. Here are my observations.

I can send messages successfully

  • On all devices (Nexus 6p, Nexus6, Nexus5), if cellular data is included
  • In Nexus6p only if cellular data is disabled

My questions:

  • Have there been any internal changes? Is it a specific device or a specific media or specific API?
  • How does sendDataMessage differ from sendTextMessage with respect to the communication channel used?
  • Should the byte [] data sent to the API be encoded in 7 bits?
+6
source share
1 answer

Regular (text) SMS messages are sent via the cellular network control channel. You can read a good description of what exactly is happening here: http://computer.howstuffworks.com/e-mail-messaging/sms.htm

When you use sendDataMessage , you send your cell data channel. It is separate from voice channels and control channels. This is why nothing is sent when the cell data is disabled.

The encoding depends on the language and on whether it is text or data. See β€œPost Size” in this article: https://en.wikipedia.org/wiki/Short_Message_Service

SMS is complicated. You might want to take a look at a solution provider such as Twilio, instead of doing it yourself.

+1
source

Source: https://habr.com/ru/post/1013444/


All Articles