English | Site Directory

Android - An Open Handset Alliance Project

android.telephony.gsm
public interface

android.telephony.gsm.ISms

android.telephony.gsm.ISms IInterface

Interface for applications to access the SIM phone book.

The following code snippet demonstrates a static method to retrieve the ISimSms interface from Android:

private static ISimSms getSimSmsInterface()
            throws DeadObjectException {
    IServiceManager sm = ServiceManagerNative.getDefault();
    ISimSms ss;
    ss = ISimSms.Stub.asInterface(sm.getService("isms"));
    return ss;
}
 

Nested Classes
ISms.Stub Local-side IPC implementation stub class. 
Known Indirect Subclasses

Summary

Public Methods

        boolean  copyMessageToSimEf(int status, byte[] pdu, byte[] smsc)
Copy a raw SMS PDU to the SIM.
        List  getAllMessagesFromSimEf()
Retrieves all messages currently stored on SIM.
        void  sendRawPdu(byte[] smsc, byte[] pdu, Intent sentIntent, Intent deliveryIntent, Intent failedIntent)
Send a SMS
        boolean  updateMessageOnSimEf(int messageIndex, int newStatus, byte[] pdu)
Update the specified message on the SIM.
Methods inherited from interface android.os.IInterface

Details

Public Methods

public boolean copyMessageToSimEf(int status, byte[] pdu, byte[] smsc)

Copy a raw SMS PDU to the SIM.

Parameters

status message status (STATUS_ON_SIM_READ, STATUS_ON_SIM_UNREAD, STATUS_ON_SIM_SENT, STATUS_ON_SIM_UNSENT)
pdu the raw PDU to store

Returns

  • success or not

public List getAllMessagesFromSimEf()

Retrieves all messages currently stored on SIM.

Returns

  • list of SmsRawData of all sms on SIM

public void sendRawPdu(byte[] smsc, byte[] pdu, Intent sentIntent, Intent deliveryIntent, Intent failedIntent)

Send a SMS

Parameters

smsc the SMSC to send the message through, or NULL for the defatult SMSC
pdu the raw PDU to send
sentIntent if not NULL this Intent is broadcast when the message is sucessfully sent
deliveryIntent if not NULL this Intent is broadcast when the message is delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").
failedIntent if not NULL this Intent is broadcast to indicate send failure. Error cause is in the extended data ("error"), and will be either ERROR_GENERIC_FAILURE or ERROR_RADIO_OFF ERROR_NULL_PDU.

public boolean updateMessageOnSimEf(int messageIndex, int newStatus, byte[] pdu)

Update the specified message on the SIM.

Parameters

messageIndex record index of message to update
newStatus new message status (STATUS_ON_SIM_READ, STATUS_ON_SIM_UNREAD, STATUS_ON_SIM_SENT, STATUS_ON_SIM_UNSENT, STATUS_ON_SIM_FREE)
pdu the raw PDU to store

Returns

  • success or not
Build m5-rc15g - 14 May 2008 12:50