Essential Android Vibration edit forum

Vibration Patterns

You can create vibration patterns by passing in an array of longs, each of which represents a duration in milliseconds. The first number is start time delay. Each array entry then alternates between vibrate, sleep, vibrate, sleep, etc.

The following example demonstrates this pattern:

long[] pattern = {0, 100, 1000, 200, 2000};

To cause the pattern to repeat, pass in the index into the pattern array at which to start the repeat, or -1 to disable repeating.

Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
vibrator.vibrate(pattern, -1); // does not repeat
vibrator.vibrate(pattern,  0); // repeats forever

Table Of Contents
39 ACRA
64 Menu
87 Vibration
112 Loader
119 Xposed
132 Colors
135 Fresco
140 AdMob
147 Button
156 Vk SDK
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close