SmsManager.SendDataMessage(String, String, Int16, Byte[], PendingIntent, PendingIntent) Method

Definition

Send a data based SMS to a specific application port.

[Android.Runtime.Register("sendDataMessage", "(Ljava/lang/String;Ljava/lang/String;S[BLandroid/app/PendingIntent;Landroid/app/PendingIntent;)V", "")]
public void SendDataMessage (string? destinationAddress, string? scAddress, short destinationPort, byte[]? data, Android.App.PendingIntent? sentIntent, Android.App.PendingIntent? deliveryIntent);
[<Android.Runtime.Register("sendDataMessage", "(Ljava/lang/String;Ljava/lang/String;S[BLandroid/app/PendingIntent;Landroid/app/PendingIntent;)V", "")>]
member this.SendDataMessage : string * string * int16 * byte[] * Android.App.PendingIntent * Android.App.PendingIntent -> unit

Parameters

destinationAddress
String

the address to send the message to

scAddress
String

is the service center address or null to use the current default SMSC

destinationPort
Int16

the port to deliver the message to

data
Byte[]

the body of the message to send

sentIntent
PendingIntent

if not NULL this <code>PendingIntent</code> is broadcast when the message is successfully sent, or failed. The result code will be <code>Activity.RESULT_OK</code> for success, or one of these errors:<br> <code>RESULT_ERROR_GENERIC_FAILURE</code><br> <code>RESULT_ERROR_RADIO_OFF</code><br> <code>RESULT_ERROR_NULL_PDU</code><br> <code>RESULT_ERROR_NO_SERVICE</code><br> <code>RESULT_ERROR_LIMIT_EXCEEDED</code><br> <code>RESULT_ERROR_FDN_CHECK_FAILURE</code><br> <code>RESULT_ERROR_SHORT_CODE_NOT_ALLOWED</code><br> <code>RESULT_ERROR_SHORT_CODE_NEVER_ALLOWED</code><br> <code>RESULT_RADIO_NOT_AVAILABLE</code><br> <code>RESULT_NETWORK_REJECT</code><br> <code>RESULT_INVALID_ARGUMENTS</code><br> <code>RESULT_INVALID_STATE</code><br> <code>RESULT_NO_MEMORY</code><br> <code>RESULT_INVALID_SMS_FORMAT</code><br> <code>RESULT_SYSTEM_ERROR</code><br> <code>RESULT_MODEM_ERROR</code><br> <code>RESULT_NETWORK_ERROR</code><br> <code>RESULT_ENCODING_ERROR</code><br> <code>RESULT_INVALID_SMSC_ADDRESS</code><br> <code>RESULT_OPERATION_NOT_ALLOWED</code><br> <code>RESULT_INTERNAL_ERROR</code><br> <code>RESULT_NO_RESOURCES</code><br> <code>RESULT_CANCELLED</code><br> <code>RESULT_REQUEST_NOT_SUPPORTED</code><br> <code>RESULT_NO_BLUETOOTH_SERVICE</code><br> <code>RESULT_INVALID_BLUETOOTH_ADDRESS</code><br> <code>RESULT_BLUETOOTH_DISCONNECTED</code><br> <code>RESULT_UNEXPECTED_EVENT_STOP_SENDING</code><br> <code>RESULT_SMS_BLOCKED_DURING_EMERGENCY</code><br> <code>RESULT_SMS_SEND_RETRY_FAILED</code><br> <code>RESULT_REMOTE_EXCEPTION</code><br> <code>RESULT_NO_DEFAULT_SMS_APP</code><br> <code>RESULT_RIL_RADIO_NOT_AVAILABLE</code><br> <code>RESULT_RIL_SMS_SEND_FAIL_RETRY</code><br> <code>RESULT_RIL_NETWORK_REJECT</code><br> <code>RESULT_RIL_INVALID_STATE</code><br> <code>RESULT_RIL_INVALID_ARGUMENTS</code><br> <code>RESULT_RIL_NO_MEMORY</code><br> <code>RESULT_RIL_REQUEST_RATE_LIMITED</code><br> <code>RESULT_RIL_INVALID_SMS_FORMAT</code><br> <code>RESULT_RIL_SYSTEM_ERR</code><br> <code>RESULT_RIL_ENCODING_ERR</code><br> <code>RESULT_RIL_INVALID_SMSC_ADDRESS</code><br> <code>RESULT_RIL_MODEM_ERR</code><br> <code>RESULT_RIL_NETWORK_ERR</code><br> <code>RESULT_RIL_INTERNAL_ERR</code><br> <code>RESULT_RIL_REQUEST_NOT_SUPPORTED</code><br> <code>RESULT_RIL_INVALID_MODEM_STATE</code><br> <code>RESULT_RIL_NETWORK_NOT_READY</code><br> <code>RESULT_RIL_OPERATION_NOT_ALLOWED</code><br> <code>RESULT_RIL_NO_RESOURCES</code><br> <code>RESULT_RIL_CANCELLED</code><br> <code>RESULT_RIL_SIM_ABSENT</code><br> <code>RESULT_RIL_SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED</code><br> <code>RESULT_RIL_ACCESS_BARRED</code><br> <code>RESULT_RIL_BLOCKED_DUE_TO_CALL</code><br> For <code>RESULT_ERROR_GENERIC_FAILURE</code> or any of the RESULT_RIL errors, the sentIntent may include the extra "errorCode" containing a radio technology specific value, generally only useful for troubleshooting.<br>

deliveryIntent
PendingIntent

if not NULL this <code>PendingIntent</code> is broadcast when the message is delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").

Attributes

Exceptions

if destinationAddress or data are empty

Remarks

Java documentation for android.telephony.SmsManager.sendDataMessage(java.lang.String, java.lang.String, short, byte[], android.app.PendingIntent, android.app.PendingIntent).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to