I really want by keyboard to give haptic feedback / vibrate when I press buttons. Just a tiny bit.
But my GBoard, which seems to be default, does not give it. I have enabled it in settings, but even when I set it to 100 ms there is nothing.
In the same category, my grocery used to vibrate on my old phone, when it had scanned a bar code. It does not on FP5.
To test it out, I found an app called Vibration Tester by “Firoj Multane”. It has some options to vibrate from 1 to 10 seconds. 1 second is silent but the others vibrate. But when I chose to vibrate in a pattern, anything down to 10 ms makes it vibrate, as long as repeat is on.
So I took it even further: I create a small app to see the code, because there are many ways to vibrate.
This deprecated method (time contains the number of ms to vibrate, language is Kotlin):
val vibrator = getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
vibrator.vibrate(time) // Deprecated method
vibrates from 1001 ms but not below that.
So I tried implementing the pattern vibration API:
val vibrator = getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
if (Build.VERSION.SDK_INT >= 26) {
val amplitudes = intArrayOf(1, 0, 50, 0, 100, 0, 255, 0)
val timings = longArrayOf(time, time, time, time, time, time, time, time)
val vibrationEffect = VibrationEffect.createWaveform(timings, amplitudes, -1)
vibrator.vibrate(vibrationEffect)
}
which worked perfectly, although it feels like the phone always uses the max amplitude. But that is ok.
So to me it seems that FP5 does not vibrate when using the old API and less than 1001 ms is specified. But it is quite annoying as many apps still uses it