public class SmsRequest extends SimpleRequest
SmsManager
requests.Modifier and Type | Field and Description |
---|---|
static String |
SEND_DATA_MESSAGE |
static String |
SEND_MULTIMEDIA_MESSAGE |
static String |
SEND_MULTIPART_TEXT_MESSAGE |
static String |
SEND_TEXT_MESSAGE |
mParams, mReceiver
Constructor and Description |
---|
SmsRequest(RequestParams params) |
Modifier and Type | Method and Description |
---|---|
static SmsRequest |
sendDataMessage(String destinationAddress,
String scAddress,
short destinationPort,
byte[] data,
android.app.PendingIntent sentIntent,
android.app.PendingIntent deliveryIntent)
Send a data based SMS to a specific application port.
|
static SmsRequest |
sendMultimediaMessage(android.content.Context context,
android.net.Uri contentUri,
String locationUrl,
android.os.Bundle configOverrides,
android.app.PendingIntent sentIntent)
Send an MMS message
|
static SmsRequest |
sendMultipartTextMessage(String destinationAddress,
String scAddress,
ArrayList<String> parts,
ArrayList<android.app.PendingIntent> sentIntents,
ArrayList<android.app.PendingIntent> deliveryIntents)
Send a multi-part text based SMS.
|
static SmsRequest |
sendTextMessage(String destinationAddress,
String scAddress,
String text,
android.app.PendingIntent sentIntent,
android.app.PendingIntent deliveryIntent)
Send a text based SMS.
|
listener, startRequest
addFilter, startRequest
public static final String SEND_DATA_MESSAGE
public static final String SEND_MULTIMEDIA_MESSAGE
public static final String SEND_MULTIPART_TEXT_MESSAGE
public static final String SEND_TEXT_MESSAGE
public SmsRequest(RequestParams params)
public static SmsRequest sendDataMessage(String destinationAddress, String scAddress, short destinationPort, byte[] data, android.app.PendingIntent sentIntent, android.app.PendingIntent deliveryIntent)
Note: Using this
method requires that your app has the Manifest.permission.SEND_SMS
permission.
destinationAddress
- the address to send the message toscAddress
- is the service center address or null to use the current default SMSCdestinationPort
- the port to deliver the message todata
- the body of the message to sendsentIntent
- if not NULL this PendingIntent
is broadcast when the message is
successfully sent, or failed. The result code will be Activity.RESULT_OK
for success, or one of these errors:RESULT_ERROR_GENERIC_FAILURE
RESULT_ERROR_RADIO_OFF
RESULT_ERROR_NULL_PDU
RESULT_ERROR_GENERIC_FAILURE
the sentIntent may include the extra
"errorCode" containing a radio technology specific value, generally only useful for
troubleshooting.deliveryIntent
- if not NULL this PendingIntent
is broadcast when the message is delivered
to the recipient. The raw pdu of the status report is in the extended data ("pdu").IllegalArgumentException
- if destinationAddress or data are emptypublic static SmsRequest sendMultimediaMessage(android.content.Context context, android.net.Uri contentUri, String locationUrl, android.os.Bundle configOverrides, android.app.PendingIntent sentIntent)
context
- application contextcontentUri
- the content Uri from which the message pdu will be readlocationUrl
- the optional location url where message should be sent toconfigOverrides
- the carrier-specific messaging configuration values to override for sending the message.sentIntent
- if not NULL this PendingIntent
is broadcast when the message is successfully
sent, or failedIllegalArgumentException
- if contentUri is emptypublic static SmsRequest sendMultipartTextMessage(String destinationAddress, String scAddress, ArrayList<String> parts, ArrayList<android.app.PendingIntent> sentIntents, ArrayList<android.app.PendingIntent> deliveryIntents)
divideMessage
. Note: Using this method requires
that your app has the Manifest.permission.SEND_SMS
permission.
Note: Beginning with Android 4.4 (API level 19), if and only if 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 Telephony
.
destinationAddress
- the address to send the message toscAddress
- is the service center address or null to use the current default SMSCparts
- an ArrayList
of strings that, in order, comprise the original messagesentIntents
- if not null, an ArrayList
of PendingIntent
s (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:RESULT_ERROR_GENERIC_FAILURE
RESULT_ERROR_RADIO_OFF
RESULT_ERROR_NULL_PDU
RESULT_ERROR_GENERIC_FAILURE
each sentIntent may include the extra "errorCode" containing a radio technology
specific value, generally only useful for troubleshooting.deliveryIntents
- if not null, an ArrayList
of PendingIntent
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").IllegalArgumentException
- if destinationAddress or data are emptypublic static SmsRequest sendTextMessage(String destinationAddress, String scAddress, String text, android.app.PendingIntent sentIntent, android.app.PendingIntent deliveryIntent)
Note: Using this method requires that your app has
the Manifest.permission.SEND_SMS
permission.
Note:
Beginning with Android 4.4 (API level 19), if and only if 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 Telephony
.
destinationAddress
- the address to send the message toscAddress
- is the service center address or null to use the current default SMSCtext
- the body of the message to sendsentIntent
- if not NULL this PendingIntent
is broadcast when the message is
successfully sent, or failed. The result code will be Activity.RESULT_OK
for success, or one of these errors:RESULT_ERROR_GENERIC_FAILURE
RESULT_ERROR_RADIO_OFF
RESULT_ERROR_NULL_PDU
RESULT_ERROR_GENERIC_FAILURE
the sentIntent may include the extra
"errorCode" containing a radio technology specific value, generally only useful for
troubleshooting.deliveryIntent
- if not NULL this PendingIntent
is broadcast when the message is delivered
to the recipient. The raw pdu of the status report is in the extended data ("pdu").IllegalArgumentException
- if destinationAddress or text are empty