Share via


SmsManager.SendMultipartTextMessage Method

Definition

Overloads

SendMultipartTextMessage(String, String, IList<String>, IList<PendingIntent>, IList<PendingIntent>)

Send a multi-part text based SMS.

SendMultipartTextMessage(String, String, IList<String>, IList<PendingIntent>, IList<PendingIntent>, Int64)

Send a multi-part text based SMS.

SendMultipartTextMessage(String, String, IList<String>, IList<PendingIntent>, IList<PendingIntent>, String, String)

Similar method as #sendMultipartTextMessage(String, String, ArrayList, ArrayList, ArrayList) With an additional argument.

SendMultipartTextMessage(String, String, IList<String>, IList<PendingIntent>, IList<PendingIntent>)

Send a multi-part text based SMS.

[Android.Runtime.Register("sendMultipartTextMessage", "(Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)V", "")]
public void SendMultipartTextMessage (string? destinationAddress, string? scAddress, System.Collections.Generic.IList<string>? parts, System.Collections.Generic.IList<Android.App.PendingIntent>? sentIntents, System.Collections.Generic.IList<Android.App.PendingIntent>? deliveryIntents);
[<Android.Runtime.Register("sendMultipartTextMessage", "(Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)V", "")>]
member this.SendMultipartTextMessage : string * string * System.Collections.Generic.IList<string> * System.Collections.Generic.IList<Android.App.PendingIntent> * System.Collections.Generic.IList<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

parts
IList<String>

an ArrayList of strings that, in order, comprise the original message

sentIntents
IList<PendingIntent>

if not null, an ArrayList of PendingIntents (one for each message part) that is broadcast when the corresponding message part has been sent. The result code will be Activity.RESULT_OK for success, or one of these errors:<br> RESULT_ERROR_GENERIC_FAILURE<br> RESULT_ERROR_RADIO_OFF<br> RESULT_ERROR_NULL_PDU<br> RESULT_ERROR_NO_SERVICE<br> RESULT_ERROR_LIMIT_EXCEEDED<br> RESULT_ERROR_FDN_CHECK_FAILURE<br> RESULT_ERROR_SHORT_CODE_NOT_ALLOWED<br> RESULT_ERROR_SHORT_CODE_NEVER_ALLOWED<br> RESULT_RADIO_NOT_AVAILABLE<br> RESULT_NETWORK_REJECT<br> RESULT_INVALID_ARGUMENTS<br> RESULT_INVALID_STATE<br> RESULT_NO_MEMORY<br> RESULT_INVALID_SMS_FORMAT<br> RESULT_SYSTEM_ERROR<br> RESULT_MODEM_ERROR<br> RESULT_NETWORK_ERROR<br> RESULT_ENCODING_ERROR<br> RESULT_INVALID_SMSC_ADDRESS<br> RESULT_OPERATION_NOT_ALLOWED<br> RESULT_INTERNAL_ERROR<br> RESULT_NO_RESOURCES<br> RESULT_CANCELLED<br> RESULT_REQUEST_NOT_SUPPORTED<br> RESULT_NO_BLUETOOTH_SERVICE<br> RESULT_INVALID_BLUETOOTH_ADDRESS<br> RESULT_BLUETOOTH_DISCONNECTED<br> RESULT_UNEXPECTED_EVENT_STOP_SENDING<br> RESULT_SMS_BLOCKED_DURING_EMERGENCY<br> RESULT_SMS_SEND_RETRY_FAILED<br> RESULT_REMOTE_EXCEPTION<br> RESULT_NO_DEFAULT_SMS_APP<br> RESULT_RIL_RADIO_NOT_AVAILABLE<br> RESULT_RIL_SMS_SEND_FAIL_RETRY<br> RESULT_RIL_NETWORK_REJECT<br> RESULT_RIL_INVALID_STATE<br> RESULT_RIL_INVALID_ARGUMENTS<br> RESULT_RIL_NO_MEMORY<br> RESULT_RIL_REQUEST_RATE_LIMITED<br> RESULT_RIL_INVALID_SMS_FORMAT<br> RESULT_RIL_SYSTEM_ERR<br> RESULT_RIL_ENCODING_ERR<br> RESULT_RIL_INVALID_SMSC_ADDRESS<br> RESULT_RIL_MODEM_ERR<br> RESULT_RIL_NETWORK_ERR<br> RESULT_RIL_INTERNAL_ERR<br> RESULT_RIL_REQUEST_NOT_SUPPORTED<br> RESULT_RIL_INVALID_MODEM_STATE<br> RESULT_RIL_NETWORK_NOT_READY<br> RESULT_RIL_OPERATION_NOT_ALLOWED<br> RESULT_RIL_NO_RESOURCES<br> RESULT_RIL_CANCELLED<br> RESULT_RIL_SIM_ABSENT<br> RESULT_RIL_SIMULTANEOUS_SMS_AND_CALL_NOT_ALLOWED<br> RESULT_RIL_ACCESS_BARRED<br> RESULT_RIL_BLOCKED_DUE_TO_CALL<br> For RESULT_ERROR_GENERIC_FAILURE 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>

deliveryIntents
IList<PendingIntent>

if not null, an ArrayList of PendingIntents (one for each message part) that is broadcast when the corresponding message part has been delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").

Attributes

Remarks

Send a multi-part text based SMS. The callee should have already divided the message into correctly sized parts by calling divideMessage.

<p class="note"><strong>Note:</strong> Using this method requires that your app has the android.Manifest.permission#SEND_SMS permission.</p>

<p class="note"><strong>Note:</strong> Beginning with Android 4.4 (API level 19), if <em>and only if</em> an app is not selected as the default SMS app, the system automatically writes messages sent using this method to the SMS Provider (the default SMS app is always responsible for writing its sent messages to the SMS Provider). For information about how to behave as the default SMS app, see android.provider.Telephony.</p>

<p class="note"><strong>Note:</strong> If #getDefault() is used to instantiate this manager on a multi-SIM device, this operation may fail sending the SMS message because no suitable default subscription could be found. In this case, if sentIntent is non-null, then the PendingIntent will be sent with an error code RESULT_ERROR_GENERIC_FAILURE and an extra string "noDefault" containing the boolean value true. See #getDefault() for more information on the conditions where this operation may fail. </p>

Java documentation for android.telephony.SmsManager.sendMultipartTextMessage(java.lang.String, java.lang.String, java.util.ArrayList<java.lang.String>, java.util.ArrayList<android.app.PendingIntent>, java.util.ArrayList<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

SendMultipartTextMessage(String, String, IList<String>, IList<PendingIntent>, IList<PendingIntent>, Int64)

Send a multi-part text based SMS.

[Android.Runtime.Register("sendMultipartTextMessage", "(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;J)V", "", ApiSince=30)]
public void SendMultipartTextMessage (string destinationAddress, string? scAddress, System.Collections.Generic.IList<string> parts, System.Collections.Generic.IList<Android.App.PendingIntent>? sentIntents, System.Collections.Generic.IList<Android.App.PendingIntent>? deliveryIntents, long messageId);
[<Android.Runtime.Register("sendMultipartTextMessage", "(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;J)V", "", ApiSince=30)>]
member this.SendMultipartTextMessage : string * string * System.Collections.Generic.IList<string> * System.Collections.Generic.IList<Android.App.PendingIntent> * System.Collections.Generic.IList<Android.App.PendingIntent> * int64 -> 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

parts
IList<String>

an <code>ArrayList</code> of strings that, in order, comprise the original message

sentIntents
IList<PendingIntent>

if not null, an <code>ArrayList</code> of <code>PendingIntent</code>s (one for each message part) that is broadcast when the corresponding message part has been sent. 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>

deliveryIntents
IList<PendingIntent>

if not null, an <code>ArrayList</code> of <code>PendingIntent</code>s (one for each message part) that is broadcast when the corresponding message part has been delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").

messageId
Int64

An id that uniquely identifies the message requested to be sent. Used for logging and diagnostics purposes. The id may be 0.

Attributes

Remarks

Send a multi-part text based SMS. Same as #sendMultipartTextMessage(String, String, ArrayList, ArrayList, ArrayList), but adds an optional messageId.

Java documentation for android.telephony.SmsManager.sendMultipartTextMessage(java.lang.String, java.lang.String, java.util.List<java.lang.String>, java.util.List<android.app.PendingIntent>, java.util.List<android.app.PendingIntent>, long).

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

SendMultipartTextMessage(String, String, IList<String>, IList<PendingIntent>, IList<PendingIntent>, String, String)

Similar method as #sendMultipartTextMessage(String, String, ArrayList, ArrayList, ArrayList) With an additional argument.

[Android.Runtime.Register("sendMultipartTextMessage", "(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)V", "", ApiSince=30)]
public void SendMultipartTextMessage (string destinationAddress, string? scAddress, System.Collections.Generic.IList<string> parts, System.Collections.Generic.IList<Android.App.PendingIntent>? sentIntents, System.Collections.Generic.IList<Android.App.PendingIntent>? deliveryIntents, string packageName, string? attributionTag);
[<Android.Runtime.Register("sendMultipartTextMessage", "(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)V", "", ApiSince=30)>]
member this.SendMultipartTextMessage : string * string * System.Collections.Generic.IList<string> * System.Collections.Generic.IList<Android.App.PendingIntent> * System.Collections.Generic.IList<Android.App.PendingIntent> * string * string -> 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

parts
IList<String>

an <code>ArrayList</code> of strings that, in order, comprise the original message

sentIntents
IList<PendingIntent>

if not null, an <code>ArrayList</code> of <code>PendingIntent</code>s (one for each message part) that is broadcast when the corresponding message part has been sent. 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>

deliveryIntents
IList<PendingIntent>

if not null, an <code>ArrayList</code> of <code>PendingIntent</code>s (one for each message part) that is broadcast when the corresponding message part has been delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").

packageName
String

serves as the default package name if the package name that is associated with the user id is null.

attributionTag
String
Attributes

Remarks

Similar method as #sendMultipartTextMessage(String, String, ArrayList, ArrayList, ArrayList) With an additional argument.

<p class="note"><strong>Note:</strong> This method is intended for internal use the Telephony framework and will never trigger an SMS disambiguation dialog. If this method is called on a device that has multiple active subscriptions, this SmsManager instance has been created with #getDefault(), and no user-defined default subscription is defined, the subscription ID associated with this message will be INVALID, which will result in the SMS being sent on the subscription associated with logical slot 0. Use #getSmsManagerForSubscriptionId(int) to ensure the SMS is sent on the correct subscription. </p>

Java documentation for android.telephony.SmsManager.sendMultipartTextMessage(java.lang.String, java.lang.String, java.util.List<java.lang.String>, java.util.List<android.app.PendingIntent>, java.util.List<android.app.PendingIntent>, java.lang.String, java.lang.String).

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