In SmartDevicesPlus 5 was added the possibility to listen shake movements and execute actions followed by these movements. This functionality is currently only available for Android.
If you are working in Android and you want to use it, first you need to turn on the shake listener with the method "TurnOnShake":
Then, you need to implement the code which will be executed in the following event:
In this example, we are just counting how many times the user has shaked the device.
Finally, when you want to finish listening you need to use the method "TurnOffShake":
If you are working in IOS you only need to implement your code in the event "OnShake". It's not necessary to turn on the shake detector.
|