Vibrator App Android -
i'm using smartphone vibrate in android app i'm creating, know how can give vibrate 3 vibrated followed 100ms each.
// instance of vibrator current context vibrator vib = (vibrator) getsystemservice(context.vibrator_service); // vibrate 100ms vib.vibrate(100);
use standard vibrate method patterns parameter
public abstract void vibrate (long[] pattern, int repeat)
pass in array of ints durations turn on or off vibrator in milliseconds. first value indicates number of milliseconds wait before turning vibrator on. next value indicates number of milliseconds keep vibrator on before turning off. subsequent values alternate between durations in milliseconds turn vibrator off or turn vibrator on.
to cause pattern repeat, pass index pattern array @ start repeat, or -1 disable repeating.
this method requires caller hold permission vibrate.
parameters pattern array of longs of times turn vibrator on or off. repeat index pattern @ repeat, or -1 if don't want repeat.
Comments
Post a Comment