com.alarexgroup.m2mplf.adapters.sms
Class SMSAdapter

java.lang.Object
  extended by com.alarexgroup.m2mplf.adapters.sms.SMSAdapter
All Implemented Interfaces:
ATCommanderListener
public class SMSAdapter
extends java.lang.Object
implements ATCommanderListener

Adapter lets you send and receive SMS messages (non-binary).

Example:

import com.alarexgroup.m2mplf.adapters.sms.IncomingSMSMessage;
import com.alarexgroup.m2mplf.adapters.sms.SMSAdapter;
import com.alarexgroup.m2mplf.adapters.sms.SMSAdapterListener;

public class SMSExample implements SMSAdapterListener {
    public SMSAdapter smsAdapter;

    public SMSExample() {
       
    }
    
    public void appStart(){
        //adapter initialization
        smsAdapter = SMSAdapter.getSMSAdapter(this);
    }

    public void onMessageReceived(IncomingSMSMessage message) {
        //answer the incomming message
        //respond to the sender
        smsAdapter.sendSMS(message.getSender(),"Hi, this your is SMS response!!!");
    }
    
}

Constructor Summary
SMSAdapter()
           
 
Method Summary
static SMSAdapter getSMSAdapter(SMSAdapterListener listener)
          Method initializes adapter and returns it's instance
 void onURCEvent(java.lang.String urc)
          Internal method
static void sendPduSMS(java.lang.String pduMessage)
          Method lets you send any PDU
static void sendSMS(java.lang.String destinationNumber, java.lang.String messageText)
          Method sends an SMS message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMSAdapter

public SMSAdapter()
Method Detail

getSMSAdapter

public static SMSAdapter getSMSAdapter(SMSAdapterListener listener)
Method initializes adapter and returns it's instance

Parameters:
listener - listener
Returns:
SMSAdapter
See Also:
SMSAdapter, SMSAdapterListener

sendSMS

public static void sendSMS(java.lang.String destinationNumber,
                           java.lang.String messageText)
Method sends an SMS message

Parameters:
destinationNumber - - telephone number in international format (+420603572525)
messageText - - message text, max length = 160 chars
See Also:
SMSAdapter

sendPduSMS

public static void sendPduSMS(java.lang.String pduMessage)
Method lets you send any PDU

Parameters:
pduMessage - - message in PDU format
See Also:
SMSAdapter

onURCEvent

public final void onURCEvent(java.lang.String urc)
Internal method

Specified by:
onURCEvent in interface ATCommanderListener
Parameters:
urc - urc