version 1.0
IntroductionThis class does exactly what is says and is the simplest class I've ever made.
Latest package (library files and samples)
https://www.dropbox.com/s/p5exn94rle6f2w1/shakedetector.zip
Compiled samples (APK)
https://www.dropbox.com/s/ou4jexl4xj6nz2k/sample.apk
How to use
Declare a ShakeDetector in Sub Globals
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Detector As ShakeDetector
End Sub
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Layout1")
Detector.Initialize("Detector")
End Sub
B4X:
Sub Activity_Resume
Detector.Start
End Sub
B4X:
Sub Activity_Pause (UserClosed As Boolean)
Detector.Stop
End Sub
B4X:
Sub Detector_Shake
Log("Shake it baby!")
End Sub
Version history:
- 1.0: Initial version
That's all for now folks!
Last edited: