Motorola C381P Interface DialerListener, Sample DialerListener Implementation, EndCall

Models: C381P

1 130
Download 130 pages 15.6 Kb
Page 59
Image 59

12

Telephony API

endCall

public void endCall()

throws IOException end or cancel a phone call

Throws:

IOException - if the call could not be end or cancel.

Interface DialerListener

public interface DialerListener

The DialerListener interface provides a mechanism for the application to be notified of phone call event.

When an event arrives, the notifyDialerEvent() method is called

The listener mechanism allows applications to receive TAPI voice call event without needing to have a listener thread

If multiple event arrive very closely together in time, the implementation has calling this listener in serial.

Sample DialerListener Implementation

Dialer listener program

import java.io.IOException;

import javax.microedition.midlet.*; import javax.microedition.io.*; import com.motorola.*;

public class Example extends MIDlet implements DialerListener { Dialer dialer;

// Initial tests setup and execution.

public void startApp() { try {

dialer = Dialer.getDefaultDialer();

//Register a listener for inbound TAPI voice call events. dialer.setDialerListener(this); dialer.startCall("01065642288");

}catch (IOException e) {

//Handle startup errors

}

59

Page 59
Image 59
Motorola C381P technical manual Interface DialerListener, Sample DialerListener Implementation, EndCall