I learned that haptic feedback on a button press on Android has to be programmed individually for each button in each app.
However, is there anywhere a general setting that one can/should access that defines if the user wants haptic feedback at all?
Is there anything like a general setting to know how strong/long it should be?
Or has everything to be defined in the individual app - also posibly a setting that asks for haptic feedback on/off?
Many thanks!
Look for View.performHapticFeedback(int feedbackConstant, int flags). You specify the the underlying event (e.g. long press) and qualifier (e.g. ignore view setting, use global setting) and you get a standard vibration which is conditioned on the global Haptic Feedback setting.
It returns true if haptic feedback actually performed.
Check the source code here for more details
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.0_r1/android/view/View.java#View.performHapticFeedback%28int%2Cint%29
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With