net.rim.device.api.system
Class Alert

java.lang.Object
  |
  +--net.rim.device.api.system.Alert

public final class Alert
extends Object

Provides access to the means by which applications can notify the device's operator of interesting events (for example, arrived messages, phone calls, and so forth).

Note:

Since:
JDE 3.6.0
See Also:
AlertListener

Method Summary
static void playBuzzer(short[] tune, int volume)
          Plays a buzzer alert.
static void startAudio(short[] tune, int volume)
          Starts an audio alert.
static void startBuzzer(short[] tune, int volume)
          Starts a buzzer alert.
static void startVibrate(int duration)
          Starts a vibrate alert.
static void stopAudio()
          Cancels an audio alert in progress.
static void stopBuzzer()
          Cancels a buzzer alert in progress.
static void stopVibrate()
          Cancels a vibrate alert in progress.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

startAudio

public static void startAudio(short[] tune,
                              int volume)
Starts an audio alert. The specified tune is played via the currently selected audio channel at the specified volume. (Typically via the headset if the device is so equipped)

When the alert is completed, the AlertListener#audioDone method is invoked on the event thread.

Parameters:
tune - Tune to play; an array of note frequencies (in Hz) and durations (in ms). (ie, array[0] == the note to play, array[1] == the duration for that note)
volume - Volume, from 1 (softest) to 100 percent (loudest).
Since:
JDE 3.7.0
See Also:
AlertListener.audioDone(int)

stopAudio

public static void stopAudio()
Cancels an audio alert in progress.
Since:
JDE 3.6.0

startBuzzer

public static void startBuzzer(short[] tune,
                               int volume)
Starts a buzzer alert. The specified tune is played via the piezoelectric buzzer at the specified volume.

When the alert is completed, the AlertListener.buzzerDone(...) method is invoked on the event thread. The tune will be interrupted by any keypad or trackwheel activity.

Parameters:
tune - Tune to play; an array of note frequencies (in Hz) and durations (in ms). (ie, array[0] == the note to play, array[1] == the duration for that note)
volume - Volume, from 1 (softest) to 100 percent (loudest).
Since:
JDE 3.7.0
See Also:
AlertListener.buzzerDone(int)

playBuzzer

public static void playBuzzer(short[] tune,
                              int volume)
Plays a buzzer alert. The specified tune is played via the piezoelectric buzzer at the specified volume.

When the alert is completed, the AlertListener.buzzerDone(...) method is invoked on the event thread. The tune will not be interrupted by keypad or trackwheel activity.

Parameters:
tune - Tune to play; an array of note frequencies (in Hz) and durations (in ms). (ie, array[0] == the note to play, array[1] == the duration for that note)
volume - Volume, from 1 (softest) to 100 percent (loudest).
Since:
JDE 3.7.0
See Also:
AlertListener.buzzerDone(int)

stopBuzzer

public static void stopBuzzer()
Cancels a buzzer alert in progress.
Since:
JDE 3.6.0

startVibrate

public static void startVibrate(int duration)
Starts a vibrate alert. The device will vibrate for the specified amount of time.

When the alert is completed, the AlertListener.buzzerDone(...) method is invoked on the event thread.

Parameters:
duration - Vibrate time, in milliseconds from 0ms to 25500ms.
Since:
JDE 3.7.0
See Also:
AlertListener.vibrateDone(int)

stopVibrate

public static void stopVibrate()
Cancels a vibrate alert in progress.
Since:
JDE 3.6.0


Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.