vibrate Compat
Vibrates using this Vibrator for lengthMs milliseconds.
Requires a Manifest.permission.VIBRATE to function.
Works on versions of android down to 21.
Parameters
required which is defined in VibrationAttributes.
is defined in VibrationEffect. When null, VibrationEffect.DEFAULT_AMPLITUDE will be used.
Vibrates using this Vibrator using provided waveform.
In effect, the timings array represents the number of milliseconds before turning the vibrator on, followed by the number of milliseconds to keep the vibrator on, then the number of milliseconds turned off, and so on. Consequently, the first timing value will often be 0, so that the effect will start vibrating immediately.
Requires a Manifest.permission.VIBRATE to function.
Works on versions of android down to 21.
Parameters
required which is defined in VibrationAttributes.
the index into the waveform, at which to start indefinite repetitions of the vibration, where -1 means no repeat. If you pass anything but -1 there, you must cancel the vibration manually by calling Vibrator.cancel