Motorola E680 Technical Manual - Page 77
Interface DialerListener, Sample DialerListener Implementation
View all Motorola E680 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 77 highlights
17 Telephony API 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 } } Asynchronous callback for receive phone call event public void notifyDialerEvent(Dialer dialer, byte event) { switch (event) { 77