Reputation: 9776
I use "vibrator.vibrate(2000);" for vibration and it vibrates, but the intensity is very soft. I know that my phone is able to vibrate much stronger because when receiving a call or notification it vibrates correctly. Why is the function vibrate() so week? Thanks
Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
vibrator.vibrate(4000);
The phone vibrates really strong when receiving a text or a notification, though
Upvotes: 0
Views: 2180
Reputation: 1403
On my phone (Samsung Galaxy S3 with Android 4.3) the intensity of the vibrator is triggered by the system wide setting found in menu item
phone settings > My device > Sound > Vibration intensity
Here, you can adjust the vibration intensity for Incoming call
, Notification
and Haptic feedback
. The setting of Notification
influences the intensity of the vibration you cause with your implementation. Setting that value to zero leads to the effect that your phone does not vibrate at all with your code.
Upvotes: 0
Reputation: 1052
In most phones, the vibration is caused (quite crudely) by a minature vibration motor which has an offset weight on the shaft. Such that, when the motor is activated and the shaft spins, the offset weight causes the motor, and whatever it is attached to, to vibrate. There is no control other than the duration for which power is applied to the motor.
Though this wouldn't seem to explain why call receipt or notification manages to produce a stronger vibration than the one you get yourself through the API function. So perhaps I should have made this a comment rather than an answer? (But I couldn't see how to get the picture in a comment)
Upvotes: 2
Reputation: 54702
You can not increase further vibration intensity. So to get better feel you can use public void vibrate(long[] pattern, int repeat)
instead of vibrator.vibrate(2000);
here the patter is (from the api reference)
Pass in an array of ints that are the durations for which to turn on or off the vibrator in milliseconds. The first value indicates the number of milliseconds to wait before turning the vibrator on. The next value indicates the number of milliseconds for which to keep the vibrator on before turning it off. Subsequent values alternate between durations in milliseconds to turn the vibrator off or to turn the vibrator on.
so you can try different patterns to get a better feel. for example
final long[] pattern = { 0, 200, 500, 500, 200 };
vibrator.vibrate(pattern , 0);
you can create your own pattern to check.
Upvotes: 2
Reputation: 61
This is an educated guess as I've never used the vibrator, but perhaps try increasing the value you're passing to the function?
Upvotes: 0