Shake event

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":

 

ShakeEventImg01

 

Then, you need to implement the code which will be executed in the following event:

 

ShakeEventImg02

 

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":

 

ShakeEventImg03

 

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.