com.drismo.logic.sms
Class MyPhoneStateListener

java.lang.Object
  extended by android.telephony.PhoneStateListener
      extended by com.drismo.logic.sms.MyPhoneStateListener

public class MyPhoneStateListener
extends android.telephony.PhoneStateListener

This class reads and listens to changes in the phone state.


Field Summary
 
Fields inherited from class android.telephony.PhoneStateListener
LISTEN_CALL_FORWARDING_INDICATOR, LISTEN_CALL_STATE, LISTEN_CELL_LOCATION, LISTEN_DATA_ACTIVITY, LISTEN_DATA_CONNECTION_STATE, LISTEN_MESSAGE_WAITING_INDICATOR, LISTEN_NONE, LISTEN_SERVICE_STATE, LISTEN_SIGNAL_STRENGTH, LISTEN_SIGNAL_STRENGTHS
 
Constructor Summary
MyPhoneStateListener()
           
 
Method Summary
 void onCallStateChanged(int state, java.lang.String incomingNumber)
          The function checks if there is any incoming calls.
 
Methods inherited from class android.telephony.PhoneStateListener
onCallForwardingIndicatorChanged, onCellLocationChanged, onDataConnectionStateChanged, onDataConnectionStateChanged, onDataActivity, onMessageWaitingIndicatorChanged, onServiceStateChanged, onSignalStrengthChanged, onSignalStrengthsChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyPhoneStateListener

public MyPhoneStateListener()
Method Detail

onCallStateChanged

public void onCallStateChanged(int state,
                               java.lang.String incomingNumber)
The function checks if there is any incoming calls. On incoming calls, reply with preset SMS if auto-reply is enabled.

Overrides:
onCallStateChanged in class android.telephony.PhoneStateListener
Parameters:
state - The current phone state. (CALL_STATE_IDLE = 0, CALL_STATE_RINGING = 1, CALL_STATE_OFFHOOK = 2)
incomingNumber - When a phone call is received, this is the callers number.