src/android/Notification.java
/**
     * Beep plays the default notification ringtone.
     *
     * @param count     Number of times to play notification
     */
Beep plays the default notification ringtone.
@param count     Number of times to play notification
Beep plays the default notification ringtone . @param count Number of times to play notification
public void beep(final long count) {
        cordova.getThreadPool().execute(new Runnable() {
            public void run() {
                Uri ringtone = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
                Ringtone notification = RingtoneManager.getRingtone(cordova.getActivity().getBaseContext(), ringtone);
                if (notification != null) {
                    for (long i = 0; i < count; ++i) {
                        notification.play();
                        long timeout = BEEP_TIMEOUT;
                        while (notification.isPlaying() && (timeout > 0)) {
                            timeout = timeout - BEEP_WAIT_TINE;
                            try {
                                Thread.sleep(BEEP_WAIT_TINE);
                            } catch (InterruptedException e) {
                                Thread.currentThread().interrupt();
                            }
                        }
                    }
                }
            }
        });
    }
public void beep ( final long count ) { cordova . getThreadPool ( ) . execute ( new Runnable ( ) { public void run ( ) { Uri ringtone = RingtoneManager . getDefaultUri ( RingtoneManager . TYPE_NOTIFICATION ) ; Ringtone notification = RingtoneManager . getRingtone ( cordova . getActivity ( ) . getBaseContext ( ) , ringtone ) ; if ( notification != null ) { for ( long i = 0 ; i < count ; ++ i ) { notification . play ( ) ; long timeout = BEEP_TIMEOUT ; while ( notification . isPlaying ( ) && ( timeout > 0 ) ) { timeout = timeout - BEEP_WAIT_TINE ; try { Thread . sleep ( BEEP_WAIT_TINE ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } } } } } } ) ; }
Beep plays the default notification ringtone.
Beep plays the default notification ringtone .
// If phone is not set to silent mode