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
Forum Updated to NodeBB v4.3 + New Features

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.4k 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.
  • Y Offline
    Y Offline
    Yashpal
    wrote on 1 Sept 2017, 06:12 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
    • G Offline
      G Offline
      GTDev
      wrote on 1 Sept 2017, 08:40 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

      Y 1 Reply Last reply 5 Sept 2017, 04:44
      1
      • G GTDev
        1 Sept 2017, 08:40

        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

        Y Offline
        Y Offline
        Yashpal
        wrote on 5 Sept 2017, 04:44 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
        • G Offline
          G Offline
          GTDev
          wrote on 5 Sept 2017, 08:41 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

          1/4

          1 Sept 2017, 06:12

          • Login

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