Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to vibrate a device using Qt/QML on both Android and IOS

How to vibrate a device using Qt/QML on both Android and IOS

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 2 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • YashpalY Offline
    YashpalY Offline
    Yashpal
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    1
    • GTDevG Offline
      GTDevG Offline
      GTDev
      wrote on last edited by
      #2

      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

      Senior Developer at Felgo - https://felgo.com/qt

      Develop mobile Apps for iOS & Android with Qt
      Felgo is an official Qt Technology Partner

      YashpalY 1 Reply Last reply
      1
      • GTDevG 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,
        GTDev

        YashpalY Offline
        YashpalY Offline
        Yashpal
        wrote on last edited by
        #3

        @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?

        1 Reply Last reply
        2
        • GTDevG Offline
          GTDevG Offline
          GTDev
          wrote on last edited by
          #4

          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

          Senior Developer at Felgo - https://felgo.com/qt

          Develop mobile Apps for iOS & Android with Qt
          Felgo is an official Qt Technology Partner

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved