• Stars
    star
    2,676
  • Rank 17,077 (Top 0.4 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 9 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

โšก [Android Library] Play with sensor events & detect gestures in a breeze.

Sensey

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

The library is built for simplicity and ease of use. It eliminates most boilerplate code for dealing with setting up sensor based event and gesture detection on Android.


Built with โค๏ธŽ by Nishant Srivastava and contributors


Screenshot of sample app

sc1 sc2

Supported gestures/events

Gesture Methods Usage
Flip onFaceUp
onFaceDown
Link
Light onDark
onLight
Link
Orientation onTopSideUp
onBottomSideUp
onLeftSideUp
onRightSideUp
Link
PinchScale onScale
onScaleStart
onScaleEnd
Link
Proximity onNear
onFar
Link
Shake onShakeDetected
onShakeStopped
Link
Wave onWave Link
Chop onChop Link
WristTwist onWristTwist Link
Movement onMovement
onStationary
Link
SoundLevel onSoundDetected Link
RotationAngle onRotation Link
TiltDirection onTiltInAxisX
onTiltInAxisY
onTiltInAxisZ
Link
Scoop onScooped Link
PickupDevice onDevicePickedUp
onDevicePutDown
Link
Steps stepInformation Link
TouchType onDoubleTap
onScroll(direction)
onSingleTap
onSwipeLeft
onSwipeRight
onLongPress
onTwoFingerSingleTap
onThreeFingerSingleTap
Link

Changelog

Starting with 1.0.1, Changes exist in the releases tab.

Including in your project

Sensey is available in the Jcenter, so getting it as simple as adding it as a dependency

implementation 'com.github.nisrulz:sensey:{latest version}'

where {latest version} corresponds to published version in Download

Simple example

  • To initialize Sensey under your onCreate() in the activity/service, call
Sensey.getInstance().init(context);
  • To stop Sensey, under your onDestroy() in the activity/service, call
 // *** IMPORTANT ***
 // Stop Sensey and release the context held by it
 Sensey.getInstance().stop();
  • Next to enable shake detection

    • Create an instance of ShakeListener
    ShakeDetector.ShakeListener shakeListener=new ShakeDetector.ShakeListener() {
        @Override public void onShakeDetected() {
           // Shake detected, do something
       }
    
       @Override public void onShakeStopped() {
           // Shake stopped, do something
       }
    };
    • Now to start listening for Shake gesture, pass the instance shakeListener to startShakeDetection() function
    Sensey.getInstance().startShakeDetection(shakeListener);

    If you want to modify the threshold and time before declaring that shake gesture is stopped, use

    Sensey.getInstance().startShakeDetection(threshold,timeBeforeDeclaringShakeStopped,shakeListener);
    • To stop listening for Shake gesture, pass the instance shakeListener to stopShakeDetection() function
    Sensey.getInstance().stopShakeDetection(shakeListener);

๐Ÿ“ƒ For more info , check the Wiki Docs

Pull Requests

I welcome and encourage all pull requests. It usually will take me within 24-48 hours to respond to any issue or request. Here are some basic rules to follow to ensure timely addition of your request:

  1. Match coding style (braces, spacing, etc.) This is best achieved using CMD+Option+L (Reformat code) on Mac (not sure for Windows) with Android Studio defaults. This project uses a modified version of Grandcentrix's code style, so please use the same when editing this project.
  2. If its a feature, bugfix, or anything please only change code to what you specify.
  3. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)
  4. Pull requests must be made against develop branch. Any other branch (unless specified by the maintainers) will get rejected.
  5. Check for existing issues first, before filing an issue.
  6. Have fun!

References of Sensey

Sensey is being used in production apps as well as research & development for thesis at universities.

Click here for the full list of references

License

Licensed under the Apache License, Version 2.0, click here for the full license.

Author & Contributors

This project was created by Nishant Srivastava but hopefully developed and maintained by many others. See the the list of contributors here.

Ways You Can Help/Support this project

Thanks for your interest in this software โค๏ธ

More Repositories

1

flutter-examples

[Examples] Simple basic isolated apps, for budding flutter devs.
Dart
6,550
star
2

android-tips-tricks

โ˜‘๏ธ [Cheatsheet] Tips and tricks for Android Development
Java
4,680
star
3

app-privacy-policy-generator

A simple web app to generate a generic privacy policy for your Android/iOS apps
Sass
3,415
star
4

easydeviceinfo

๐Ÿ“ฑ [Android Library] Get device information in a super easy way.
Java
1,736
star
5

android-examples

:shipit: [Examples] Simple basic isolated apps, for budding android devs.
Java
1,732
star
6

recyclerviewhelper

๐Ÿ“ƒ [Android Library] Giving powers to RecyclerView
Java
639
star
7

qreader

๐Ÿ”ณ [Android Library] Read QR codes using google's mobile vision api, but without the hassle
Java
368
star
8

screenshott

[Android Library] Take a screenshot of your view layout , programmatically!
Java
325
star
9

android-utils

[Android Library] Facilitating some very common functionalities in the form of utility classes for Android
Java
142
star
10

packagehunter

๐Ÿ“ฅ [Android Library] Hunt down all package information
Java
140
star
11

twitterbot-nodejs

[Bot] A twitter bot made using nodejs which can post tweets, retweet other tweets and possibly fav tweets
JavaScript
139
star
12

validatetor

Android library for fast and simple string validation
Java
139
star
13

zentone

๐Ÿ”‰ [Android Library] Easily generate audio tone of a specific frequency and volume in Android.
Kotlin
109
star
14

javadoc-themer

[Javadoc Tool] Give your boooring javadocs a splash of colors!
HTML
83
star
15

lantern

[Android Library] Handling device flash as torch for Android.
Java
82
star
16

FirebaseExample

๐Ÿ”ฅ Simplistic example app demonstrating using latest Firebase features. Checkout branches for each feature.
Java
60
star
17

UploadToBintray

[Example] Awesome library built to demonstrate the process of publishing android libraries via JCenter/Bintray
Java
53
star
18

java-interview-questions

Byte sized java tech interview coding questions
Java
43
star
19

nisrulz.github.io

Everything about Nishant Srivastava/nisrulz (online alias)
CSS
43
star
20

UploadToJitpack

[Example] Base repository to demonstrate the process of uploading an aar/jar to JitPack
Kotlin
39
star
21

OptimusHTTP

๐Ÿ“ก [Android Library] Simplified async networking in android
Java
35
star
22

terminal-utils

[Utils] A growing list of useful terminal utility/commands and bash scripts to automate your life!
Shell
33
star
23

twitterbot-java

[Bot] Twitter bot to automate few tasks on twitter.
Java
16
star
24

ShoutOut

[Android Library] Log information in android
Kotlin
15
star
25

SelfieApp

A simple app to demonstrate building applications in android. The app lets you take selfies and show it as list inside the app.
Java
14
star
26

EvTrack

[Android Library] Make event and exception tracking like a piece of cake
Java
13
star
27

LearnKotlin

[Example] Learning Kotlin programming in Android
Kotlin
12
star
28

AndroidAutomations

An android example app to demonstrate various automations possible.
Kotlin
10
star
29

convert-md-to-pdf

Convert Markdown to PDF
JavaScript
10
star
30

puppeteer-examples

[Examples] Simple basic isolated node scripts for doing stuff with puppeteer
JavaScript
8
star
31

android-lib-init-examples

[Examples] Simple basic isolated android examples to showcase various library initialization mechanisms
Kotlin
8
star
32

SupportCamera

[Android Library] Support library to handle camera api on all android versions
Java
7
star
33

UploadToMavenCentral

[Example] Base repository to demonstrate the process of uploading an aar/jar to maven central.
Kotlin
7
star
34

nisrulz

Github Frontpage
5
star
35

ortwin-slack-bot

๐Ÿ›Ž Your point friend in the slack workspace
JavaScript
5
star
36

Parallax-One-Pager-Template

[Template] A simple one pager parallax scrolling template
HTML
5
star
37

angular-seed

[Template] A simple angular-based seed website
CSS
4
star
38

gradle-playground

Sample project for raywenderlich.com tutorial
Kotlin
4
star
39

JetSetCompose

Example app for Jet Set Compose talk
Kotlin
4
star
40

kmp-examples

Main repository containing all the example apps demonstrating features/functionality/integrations using Kotlin MultiPlatform development.
Kotlin
4
star
41

nisrulz-android-settings

[Config] Android Studio settings and code styles used by me
3
star
42

mavenrepo

[Example] Github-Based Maven Repository
3
star
43

LearnRetrofit

[Example] Learning how to use retrofit android library
Java
3
star
44

release-automation-playstore

An automated workflow to update Playstore metadata for an android application.
Ruby
3
star
45

CoroutineRecipes

Executable example code from my talk "Cooking with Coroutines Recipes"
Kotlin
3
star
46

bygone-projects

This repository contains projects that I had worked upon in my past, possibly when I was at school (pre-college).
C++
2
star
47

advent-of-code-2021

Repository with solutions for Advent Of Code 2021 puzzles.
2
star
48

android-dev-wrapped-generator

A simple web app to generate your own Android Dev Wrapped!
HTML
2
star
49

.github

Default community health files
1
star
50

gcm-nodejs-server

[NodeJS] NodeJS GCM Server
JavaScript
1
star
51

KotlinCompileFromCmdLine

This is a repository to compile a pure kotlin project without a build system such as Gradle.
Kotlin
1
star
52

release-automation-apple-connect

An automated workflow to update Apple Appstore metadata for an iOS application.
Ruby
1
star