Haptics on Android
-
Just a generic question, did anyone manage to get haptics (vibrations) working on Android on their Qt / QML application?
I tried for most of today before giving up.
- the Android call
View.performHapticFeedbackhits the snag that there doesn't seem to be any way to get a "View" instance in a QML application.
Using the context.getWindow().getDecoreView() gives you a view, but not sure why, calling the haptics on there didn't do anything. - Calling the following Java likewise had no effect:
public static void click(Context context) { VibratorManager vm = (VibratorManager) context.getSystemService(Context.VIBRATOR_MANAGER_SERVICE); Vibrator vibrator = vm.getDefaultVibrator(); vibrator.vibrate(VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK)); } // additionally added to the manifest this line: <uses-permission android:name="android.permission.VIBRATE"/>If anyone knows of a Qt app that successfully added haptics (simple is fine), please do share the details!
- the Android call