Can you increase vibrator strength on android devices?

夙愿已清 提交于 2019-12-10 13:27:38

问题


Is it possible to increase the strength of the alarm vibration?


回答1:


apparently not,

under android.os.Vibrator, you can set the pattern as well as the duration

vibrate(long[] pattern, int repeat)

vibrate(long milliseconds) 

my guess is that different patterns can be used to "simulate" a stronger vibrate. (on,off,on,off) rather than (on, off, off, off, on).

also a disharmonious pattern may be more effective than a pattern with a fixed rhythm.




回答2:


The Vibrator Class does not allow for this, you can only set the duration.




回答3:


from API 26 onwards, you can change the strength by setting the amplitude of VibrationEffect

https://developer.android.com/reference/android/os/VibrationEffect.html

simply create VibrationEffect effect = VibrationEffect.createOneShot ( milliseconds, amplitude);

and then set the effect in the vibrator instance.

vibrator.vibrate(effect);

more details here

https://developer.android.com/reference/android/os/Vibrator.html#vibrate(android.os.VibrationEffect)



来源:https://stackoverflow.com/questions/8907219/can-you-increase-vibrator-strength-on-android-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!