com.github.nisrulz:sensey

Android library which makes playing with sensor events & detecting gestures a breeze.


Keywords
android, android-library, chop-detection, detect-gestures, gesture-detection, handwave-detection, libraries, light-detection, movement-detection, proximity-sensor, sensor, shake-detection, wave-detection, wrist-twist-detection
License
Apache-2.0

Documentation

enter image description here

Sensey

Making gesture detection a breeze.

Checkout the code on here.

Integration

  • Sensey is available in the MavenCentral, so getting it as simple as adding it as a dependency
compile 'com.github.nisrulz:sensey:1.0.1'

Usage

  • Initialize Sensey under your onCreate() in the activity/service
Sensey.getInstance().init(context);
  • Next to enable detection for

    • Shake

      Sensey.getInstance().startShakeDetection(new ShakeDetector.ShakeListener() {
                        @Override
                        public void onShakeDetected() {
                            // Shake detected, do something
                        }
                    });
    • Flip

      Sensey.getInstance().startFlipDetection(new FlipDetector.FlipListener() {
                          @Override
                          public void onFaceUp() {
                              // Face up detected, do something
                          }
      
                          @Override
                          public void onFaceDown() {
                              // Face down detected, do something
                          }
                      });
    • Orientation

      Sensey.getInstance().startOrientationDetection(new OrientationDetector.OrientationListener() {
                          @Override
                          public void onTopSideUp() {
                              // Top side up detected, do something
                          }
      
                          @Override
                          public void onBottomSideUp() {
                               // Bottom side up detected, do something
                          }
      
                          @Override
                          public void onRightSideUp() {
                              // Right side up detected, do something
                          }
      
                          @Override
                          public void onLeftSideUp() {
                               // Left side up detected, do something
                          }
                      });
    • Proximity

      Sensey.getInstance().startProximityDetection(new ProximityDetector.ProximityListener() {
                          @Override
                          public void onNear() {
                              // Near, do something
                          }
      
                          @Override
                          public void onFar() {
                              // far, do something
                          }
                      });
  • To disable detection for

    • Shake
     Sensey.getInstance().stopShakeDetection();
    • Flip
      Sensey.getInstance().stopFlipDetection();
    • Orientation
     Sensey.getInstance().stopOrientationDetection();
    • Proximity
     Sensey.getInstance().stopProximityDetection();

    NOTE : Some variables used in build.gradle correspond to COMPILE_SDK_VERSION=23 BUILDTOOLS_VERSION=23.0.1 VERSION_NAME=1.0.1 VERSION_CODE=2

License

Apache License 2.0