com.vodafone.v10.midlet
Class ResidentMIDlet

java.lang.Object
  |
  +--javax.microedition.midlet.MIDlet
        |
        +--com.vodafone.v10.midlet.ResidentMIDlet
All Implemented Interfaces:
MailListener, RingStateListener, ScheduledAlarmListener, TelephonyListener

public abstract class ResidentMIDlet
extends javax.microedition.midlet.MIDlet
implements TelephonyListener, MailListener, ScheduledAlarmListener, RingStateListener

ResidentMIDlet is the base class for creating a resident application.

A resident application is a MIDlet for which the MIDxlet-Resident descriptor in the Jad file is set to "Y"; its function is to listen for incoming calls to the handset. The telephony functions TelephonyListener, MailListener, ScheduledAlarmListener, and RingStateListener must be implemented in this MIDlet. These interface methods are declared as abstract methods in ResidentMIDlet.

Incoming Call and Alarm Notification in ResidentMIDlet

ResidentMIDlet processes occurrences of incoming voice calls, incoming mail, or scheduled alarms in the following sequence.

  1. An incoming voice call, mail arrival, or scheduled alarm occurs in the handset.

  2. If a media player that issues sound is playing, it is stopped and the MediaPlayerListener class mediaStateChanged() method is called. If a sound player is playing, the player is stopped but the SoundTrackListener interface eventOccurred() method is not called. Vibrator and LCD backlight control is stopped.

  3. The user is notified of the incoming call or alarm. The content of the notification is as set in the native host system. In some cases the JVM may be paused by a user operation.

  4. At voice call incoming (start of telephone ringing), the TelephonyListener interface ring() method is called; for mail arrival the MailListener received() is called, and for an alarm the ScheduledAlarmListener notice() is called.

  5. The RingStateListener interface ringStarted() method is called.

  6. The RingStateListener interface ringStopped() method is called. There are three possible timings for calling of the ringStopped() method, as follows.

  7. If the notification was for an incoming voice call, the TelephonyListener hungup() method is called.

RingStateListener event notification takes place only when the MIDlet is running as a resident application.

A RuntimeException exception is thrown if a media player using audio, a sound player, vibrator, or LCD backlight function is used during the interval from event listener calling in 4 above (not including calls inside the listener) to the calling of the RingStateListener ringStopped() method in 6 above (not including calls inside ringStopped()). Once the ringStopped() method has been called, media player, sound player, vibrator and LCD backlight operations are again allowed. It is allowable, for example, to resume a media player or sound player inside ringStopped().

Incoming Call and Alarm Notification in a Resident MIDlet

The following event notification by itself in a resident MIDlet does not cause the native system to perform any user notification. The way in which notification is made to the user is up to the MIDlet.

Table 1. Incoming Call Events in the Resident MIDlet
Timing Called listener method
Incoming voice call (start of phone ringing) TelephonyListener ring() method
End of phone ringing, or resuming of JVM after it was paused TelephonyListener hungup() method
Mail arrival MailListener received() method
Alarm ScheduledAlarmListener notice() method


Fields inherited from interface com.vodafone.v10.system.device.MailListener
CBS, MMS, SMS, WEB
 
Constructor Summary
protected ResidentMIDlet()
           
 
Method Summary
abstract  void hungup()
          Called when a call is ended, or when an application resumes after a call ends.
abstract  void notice(java.lang.String comment)
          Called at the time of a scheduled alarm.
abstract  void received(int type)
          Called when mail arrives.
abstract  void ring()
          Called when a phone call is incoming.
abstract  void ringStarted()
          Called when incoming call notification (ringing) starts.
abstract  void ringStopped()
          Called when incoming call notification (ringing) stops.
 
Methods inherited from class javax.microedition.midlet.MIDlet
destroyApp, getAppProperty, notifyDestroyed, notifyPaused, pauseApp, resumeRequest, startApp
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResidentMIDlet

protected ResidentMIDlet()
Method Detail

ring

public abstract void ring()
Called when a phone call is incoming.
Specified by:
ring in interface TelephonyListener

hungup

public abstract void hungup()
Called when a call is ended, or when an application resumes after a call ends.
Specified by:
hungup in interface TelephonyListener

received

public abstract void received(int type)
Called when mail arrives.
Specified by:
received in interface MailListener
Parameters:
type - The type of mail

notice

public abstract void notice(java.lang.String comment)
Called at the time of a scheduled alarm.
Specified by:
notice in interface ScheduledAlarmListener
Parameters:
comment - Comment

ringStarted

public abstract void ringStarted()
Called when incoming call notification (ringing) starts.
Specified by:
ringStarted in interface RingStateListener

ringStopped

public abstract void ringStopped()
Called when incoming call notification (ringing) stops.
Specified by:
ringStopped in interface RingStateListener


Copyright 2002,2003 Aplix Corporation. All rights reserved. Aplix Confidential and Restricted.