SmsManagerpublic final class SmsManager extends Object Manages SMS operations such as sending data, text, and pdu SMS messages.
Get this object by calling the static method SmsManager.getDefault(). |
Fields Summary |
---|
private static SmsManager | sInstance | private android.telephony.SmsManager | mSmsMgrProxy | public static final int | STATUS_ON_SIM_FREEFree space (TS 51.011 10.5.3). | public static final int | STATUS_ON_SIM_READReceived and read (TS 51.011 10.5.3). | public static final int | STATUS_ON_SIM_UNREADReceived and unread (TS 51.011 10.5.3). | public static final int | STATUS_ON_SIM_SENTStored and sent (TS 51.011 10.5.3). | public static final int | STATUS_ON_SIM_UNSENTStored and unsent (TS 51.011 10.5.3). | public static final int | RESULT_ERROR_GENERIC_FAILUREGeneric failure cause | public static final int | RESULT_ERROR_RADIO_OFFFailed because radio was explicitly turned off | public static final int | RESULT_ERROR_NULL_PDUFailed because no pdu provided | public static final int | RESULT_ERROR_NO_SERVICEFailed because service is currently unavailable |
Constructors Summary |
---|
private SmsManager()
mSmsMgrProxy = android.telephony.SmsManager.getDefault();
|
Methods Summary |
---|
public final boolean | copyMessageToSim(byte[] smsc, byte[] pdu, int status)Copy a raw SMS PDU to the SIM.
return mSmsMgrProxy.copyMessageToIcc(smsc, pdu, status);
| public final boolean | deleteMessageFromSim(int messageIndex)Delete the specified message from the SIM.
return mSmsMgrProxy.deleteMessageFromIcc(messageIndex);
| public final java.util.ArrayList | divideMessage(java.lang.String text)Divide a text message into several messages, none bigger than
the maximum SMS message size.
return mSmsMgrProxy.divideMessage(text);
| public final java.util.ArrayList | getAllMessagesFromSim()Retrieves all messages currently stored on SIM.
return android.telephony.SmsManager.getDefault().getAllMessagesFromIcc();
| public static final android.telephony.gsm.SmsManager | getDefault()Get the default instance of the SmsManager
if (sInstance == null) {
sInstance = new SmsManager();
}
return sInstance;
| public final void | sendDataMessage(java.lang.String destinationAddress, java.lang.String scAddress, short destinationPort, byte[] data, android.app.PendingIntent sentIntent, android.app.PendingIntent deliveryIntent)Send a data based SMS to a specific application port.
mSmsMgrProxy.sendDataMessage(destinationAddress, scAddress, destinationPort,
data, sentIntent, deliveryIntent);
| public final void | sendMultipartTextMessage(java.lang.String destinationAddress, java.lang.String scAddress, java.util.ArrayList parts, java.util.ArrayList sentIntents, java.util.ArrayList deliveryIntents)Send a multi-part text based SMS. The callee should have already
divided the message into correctly sized parts by calling
divideMessage .
mSmsMgrProxy.sendMultipartTextMessage(destinationAddress, scAddress, parts,
sentIntents, deliveryIntents);
| public final void | sendTextMessage(java.lang.String destinationAddress, java.lang.String scAddress, java.lang.String text, android.app.PendingIntent sentIntent, android.app.PendingIntent deliveryIntent)Send a text based SMS.
mSmsMgrProxy.sendTextMessage(destinationAddress, scAddress, text,
sentIntent, deliveryIntent);
| public final boolean | updateMessageOnSim(int messageIndex, int newStatus, byte[] pdu)Update the specified message on the SIM.
return mSmsMgrProxy.updateMessageOnIcc(messageIndex, newStatus, pdu);
|
|