How to vibrate a device using Qt/QML on both Android and IOS
-
wrote on 1 Sept 2017, 06:12 last edited by
Hi folks, I'm looking for that piece of module in Qt/QML, to vibrate a device for a time period in demand. Also, I expect that module to work both on Android and IOS flawlessly. Is there anyone who has previously worked on this item?
Thank you
-
wrote on 1 Sept 2017, 08:40 last edited by
Hi Yashpal!
You can have a look at V-Play Engine for Qt-based mobile apps and games. It offers a NativeUtils component which allows to trigger native features for both iOS and Android, as well as many other components to make mobile development with Qt easier.
It's possible to vibrate the phone with a simple method call:
App { AppButton { text: "vibrate" onClicked: { nativeUtils.vibrate() } } }
Best,
GTDev -
Hi Yashpal!
You can have a look at V-Play Engine for Qt-based mobile apps and games. It offers a NativeUtils component which allows to trigger native features for both iOS and Android, as well as many other components to make mobile development with Qt easier.
It's possible to vibrate the phone with a simple method call:
App { AppButton { text: "vibrate" onClicked: { nativeUtils.vibrate() } } }
Best,
GTDevwrote on 5 Sept 2017, 04:44 last edited by@GTDev Yes, I went through Vplay documentation, really fab stuff. Now that all I want know is how to control the duration of vibration. Think that, I want the device to vibrate for say 2 seconds, 4 seconds and 6 seconds respectively now, how can we do this?
-
wrote on 5 Sept 2017, 08:41 last edited by
Hi,
V-Play as a cross-platform engine allows to vibrate the iOS or Android device with a single method call, which then triggers the native iOS or Android vibration features.
On Android, it is possible to specify the vibration duration, but iOS currently does not allow to change the duration with their public API. So the vibrate() function only tells the phone to vibrate on iOS and on Android a default duration of 300ms is used.
Best,
GTDev
1/4