Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Vibration patterns, Android OpenSesame

Hello,


is there a way to induce specific vibration patterns on the phone for an experiment running on Android with OpenSesame?


Thank you in advance

Comments

  • Hi @bbkm ,

    Just to clarify: the OpenSesame runtime for Android is no longer maintained, and only still works on very old devices. So don't use that!

    You can, however, run OSWeb experiments in Android through the browser. And then you can use the window.navigator.vibrate() function to make supported devices vibrate. This will be silently ignored on the devices that don't vibrate or browsers that don't support this though!

    The following code, which you can put in an inline_javascript item, will make a device vibrate for 300 ms, be silent for 100 ms, then vibrate for 200 ms, be silent for 50 ms, and finally vibrate for another 300 ms.

    window.navigator.vibrate([300, 100, 200, 50, 300])
    

    Hope this is useful!

    -- Sebastiaan

  • Hello @sebastiaan

    that was very helpful ! Thank you very much for that!

Sign In or Register to comment.