Vibration after regular intervals

Posted by umar on Stack Overflow See other posts from Stack Overflow or by umar
Published on 2012-09-06T03:36:32Z Indexed on 2012/09/06 3:37 UTC
Read the original article Hit count: 160

Filed under:
|
|

I have a beep system which gives you four beeps. One beep after a second for one second.

However If its silent mode i want the vibrator to do the same, vibrate for 1 second 4 times after 1 second.

This is the code I am using

 long[] pattern = new long[2];
                    pattern[0] = 10;
                    pattern [1] = 30;
                      switch (am.getRingerMode()) 
                      {

                      case AudioManager.RINGER_MODE_VIBRATE:
                          vibe.vibrate(pattern, 0);
                          break;
                      case AudioManager.RINGER_MODE_NORMAL:
                          soundsOn(mp);
                          break;

Kindly how can i do what i want to do

Best Regards

© Stack Overflow or respective owner

Related posts about java

Related posts about android