|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.microedition.midlet.MIDlet | +--com.vodafone.v10.midlet.ResidentMIDlet
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.
ResidentMIDlet processes occurrences of incoming voice calls, incoming mail, or scheduled alarms in the following sequence.
An incoming voice call, mail arrival, or scheduled alarm occurs in the handset.
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.
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.
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.
The RingStateListener interface ringStarted()
method is called.
The RingStateListener interface ringStopped()
method is called. There are three possible timings for calling of the ringStopped()
method, as follows.
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()
.
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.
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 |
protected ResidentMIDlet()
Method Detail |
public abstract void ring()
ring
in interface TelephonyListener
public abstract void hungup()
hungup
in interface TelephonyListener
public abstract void received(int type)
received
in interface MailListener
type
- The type of mailpublic abstract void notice(java.lang.String comment)
notice
in interface ScheduledAlarmListener
comment
- Commentpublic abstract void ringStarted()
ringStarted
in interface RingStateListener
public abstract void ringStopped()
ringStopped
in interface RingStateListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |