{"id":3672,"url":"https://github.com/nisrulz/sensey","last_synced_at":"2025-05-14T22:08:53.896Z","repository":{"id":39618138,"uuid":"46035308","full_name":"nisrulz/sensey","owner":"nisrulz","description":":zap: [Android Library] Play with sensor events \u0026 detect gestures in a breeze.","archived":false,"fork":false,"pushed_at":"2024-07-07T23:34:36.000Z","size":38125,"stargazers_count":2669,"open_issues_count":28,"forks_count":268,"subscribers_count":72,"default_branch":"master","last_synced_at":"2025-04-10T10:01:51.199Z","etag":null,"topics":["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"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nisrulz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"nisrulz","ko_fi":"nisrulz","buy_me_a_coffee":"nisrulz","custom":["https://revolut.me/nisrulz","https://www.paypal.me/nisrulz/5eur"]}},"created_at":"2015-11-12T06:58:21.000Z","updated_at":"2025-03-31T20:20:20.000Z","dependencies_parsed_at":"2024-11-26T15:15:10.883Z","dependency_job_id":null,"html_url":"https://github.com/nisrulz/sensey","commit_stats":{"total_commits":254,"total_committers":4,"mean_commits":63.5,"dds":0.05905511811023623,"last_synced_commit":"7ae78d66ae6defa006cfc6f9c7a732c118233693"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nisrulz%2Fsensey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nisrulz%2Fsensey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nisrulz%2Fsensey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nisrulz%2Fsensey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nisrulz","download_url":"https://codeload.github.com/nisrulz/sensey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235700,"owners_count":22036964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"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"],"created_at":"2024-01-05T20:16:48.160Z","updated_at":"2025-05-14T22:08:48.865Z","avatar_url":"https://github.com/nisrulz.png","language":"Java","funding_links":["https://github.com/sponsors/nisrulz","https://ko-fi.com/nisrulz","https://buymeacoffee.com/nisrulz","https://revolut.me/nisrulz","https://www.paypal.me/nisrulz/5eur","https://www.paypal.me/nisrulz/5usd","https://www.buymeacoffee.com/nisrulz"],"categories":["Kotlin","Gesture","[Programming]","Java","Libraries","手势操作"],"sub_categories":["[Programming] - [Android]","Other"],"readme":"\u003cdiv align=\"center\"\u003e\r\n  \u003cimg src=\"/img/logo_color.png\" height=\"128\" /\u003e\r\n\u003c/div\u003e\r\n\r\n\u003ch1 align=\"center\"\u003eSensey \u003ca href=\"https://twitter.com/intent/tweet?text=Sensey%3A%20Android%20library%20which%20makes%20playing%20with%20sensor%20events%20%26%20detecting%20gestures%20a%20breeze%F0%9F%98%8E\u0026url=https://github.com/nisrulz/sensey\u0026via=nisrulz\u0026hashtags=AndroidDev\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/twitter/url/http/shields.io.svg?style=social\"/\u003e\r\n    \u003c/a\u003e\u003c/h1\u003e\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n  \u003cstrong\u003eAndroid library which makes playing with sensor events \u0026 detecting gestures a breeze.\u003c/strong\u003e\r\n  \u003cp\u003eThe 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.\u003c/p\u003e\r\n\u003c/div\u003e\r\n\u003cbr/\u003e\r\n\u003cdiv align=\"center\"\u003e\r\n    \u003c!-- Bintray --\u003e\r\n    \u003ca href=\"https://bintray.com/nisrulz/maven/com.github.nisrulz%3Asensey/_latestVersion\"\u003e\r\n        \u003cimg src=\"https://api.bintray.com/packages/nisrulz/maven/com.github.nisrulz%3Asensey/images/download.svg\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- API --\u003e\r\n    \u003ca href=\"https://android-arsenal.com/api?level=14\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/badge/API-14%2B-orange.svg?style=flat\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- Android Arsenal --\u003e\r\n    \u003ca href=\"https://android-arsenal.com/details/1/3550\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/badge/Android%20Arsenal-Sensey-green.svg?style=true\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- Android Sweets --\u003e\r\n    \u003ca href=\"https://androidsweets.ongoodbits.com/2016/05/26/issue-20\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/badge/AndroidSweets-%2320-ff69b4.svg\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- Android Dev Digest --\u003e\r\n    \u003ca href=\"https://www.androiddevdigest.com/digest-100/\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/badge/AndroidDev%20Digest-%23100-blue.svg\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- Android Dev Digest --\u003e\r\n    \u003ca href=\"https://www.androiddevdigest.com/digest-131/\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/badge/AndroidDev%20Digest-%23131-blue.svg\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- Android Weekly --\u003e\r\n    \u003ca href=\"http://androidweekly.net/issues/issue-209\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/badge/Android%20Weekly-%23209-blue.svg\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- Android Weekly --\u003e\r\n    \u003ca href=\"http://androidweekly.net/issues/issue-245\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/badge/Android%20Weekly-%23245-blue.svg\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- Number of Android apps (AppBrain) --\u003e\r\n    \u003ca href=\"https://www.appbrain.com/stats/libraries/details/sensey/sensey\"\u003e\r\n        \u003cimg src=\"https://www.appbrain.com/stats/libraries/shield/sensey.svg\"\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- Awesome Android --\u003e\r\n    \u003ca href=\"https://snowdream.github.io/awesome-android/Other.html#Gesture\"\u003e\r\n        \u003cimg src=\"https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- GitHub stars --\u003e\r\n    \u003ca href=\"https://github.com/nisrulz/sensey\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/github/stars/nisrulz/sensey.svg?style=social\u0026label=Star\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- GitHub forks --\u003e\r\n    \u003ca href=\"https://github.com/nisrulz/sensey/fork\"\u003e\r\n        \u003cimg src=\"hhttps://img.shields.io/github/forks/nisrulz/sensey.svg?style=social\u0026label=Fork\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- GitHub watchers --\u003e\r\n    \u003ca href=\"https://github.com/nisrulz/sensey\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/github/watchers/nisrulz/sensey.svg?style=social\u0026label=Watch\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- Say Thanks! --\u003e\r\n    \u003ca href=\"https://saythanks.io/to/nisrulz\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003ca href=\"https://www.paypal.me/nisrulz/5usd\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000\u0026amp;style=flat\"\u003e\r\n    \u003c/a\u003e\r\n    \u003cbr/\u003e\r\n     \u003c!-- GitHub followers --\u003e\r\n    \u003ca href=\"https://github.com/nisrulz/sensey\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/github/followers/nisrulz.svg?style=social\u0026label=Follow%20@nisrulz\"/\u003e\r\n    \u003c/a\u003e\r\n    \u003c!-- Twitter Follow --\u003e\r\n    \u003ca href=\"https://twitter.com/nisrulz\"\u003e\r\n        \u003cimg src=\"https://img.shields.io/twitter/follow/nisrulz.svg?style=social\"/\u003e\r\n    \u003c/a\u003e\r\n\u003c/div\u003e\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n    Also featured in [Awesome Android Newsletter\r\n    \u003ca href=\"https://android.libhunt.com/newsletter/5\"\u003e\r\n         #Issue 5\r\n    \u003c/a\u003e, \r\n    \u003ca href=\"https://android.libhunt.com/newsletter/21\"\u003e\r\n         #Issue 21\r\n    \u003c/a\u003e],\r\n    \u003ca href=\"https://github.com/codepath/android_guides/wiki/Must-Have-libraries#convenience\"\u003e\r\n         Codepath's Must Have Libraries\r\n    \u003c/a\u003e, \r\n    \u003ca href=\"https://medium.cobeisfresh.com/cobes-top-5-android-libraries-september-2016-883757e61bf0#.oe2lzaxyn\"\u003e\r\n         COBE’s Top 5 Android Libraries — September 2016\r\n    \u003c/a\u003e, \r\n    \u003ca href=\"https://cloudrail.com/best-android-libraries-for-developers/\"\u003e\r\n         Best Android Libraries for Developers\r\n    \u003c/a\u003e, \r\n    \u003ca href=\"https://dzone.com/articles/this-week-in-mobile-may-15\"\u003e\r\n         DZone\r\n    \u003c/a\u003e, \r\n    \u003ca href=\"http://email.changelog.com/t/t-310383437622D164\"\u003e\r\n        Changelog Weekly Issue #115\r\n    \u003c/a\u003e\r\n\u003c/div\u003e\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n    Blog Post: \r\n    \u003ca href=\"https://android.jlelse.eu/i-could-not-find-a-simple-gesture-detection-android-library-so-i-built-one-334c0a307c16#.1us4zgise\"\u003e\r\n         I could not find a simple Gesture Detection android library, so I built one\r\n    \u003c/a\u003e\r\n\u003c/div\u003e\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n  \u003csub\u003eBuilt with ❤︎ by\r\n  \u003ca href=\"https://twitter.com/nisrulz\"\u003eNishant Srivastava\u003c/a\u003e and\r\n  \u003ca href=\"https://github.com/nisrulz/sensey/graphs/contributors\"\u003e\r\n    contributors\r\n  \u003c/a\u003e\r\n\u003c/div\u003e\r\n\u003cbr/\u003e\r\n\u003cbr/\u003e\r\n\r\n### Screenshot of sample app\r\n\r\n![sc1](img/sc1.png) ![sc2](img/sc2.png)\r\n\r\n# Supported gestures/events\r\n\r\n| Gesture       | Methods                                                                                                                                                        | Usage                                                              |\r\n| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |\r\n| Flip          | onFaceUp\u003cbr/\u003eonFaceDown                                                                                                                                        | [Link](https://github.com/nisrulz/sensey/wiki/Usage#flip)          |\r\n| Light         | onDark\u003cbr/\u003eonLight                                                                                                                                             | [Link](https://github.com/nisrulz/sensey/wiki/Usage#light)         |\r\n| Orientation   | onTopSideUp\u003cbr/\u003eonBottomSideUp\u003cbr/\u003eonLeftSideUp\u003cbr/\u003eonRightSideUp                                                                                              | [Link](https://github.com/nisrulz/sensey/wiki/Usage#orientation)   |\r\n| PinchScale    | onScale\u003cbr/\u003eonScaleStart\u003cbr/\u003eonScaleEnd                                                                                                                        | [Link](https://github.com/nisrulz/sensey/wiki/Usage#pinchscale)    |\r\n| Proximity     | onNear\u003cbr/\u003eonFar                                                                                                                                               | [Link](https://github.com/nisrulz/sensey/wiki/Usage#proximity)     |\r\n| Shake         | onShakeDetected\u003cbr/\u003eonShakeStopped                                                                                                                             | [Link](https://github.com/nisrulz/sensey/wiki/Usage#shake)         |\r\n| Wave          | onWave                                                                                                                                                         | [Link](https://github.com/nisrulz/sensey/wiki/Usage#wave)          |\r\n| Chop          | onChop                                                                                                                                                         | [Link](https://github.com/nisrulz/sensey/wiki/Usage#chop)          |\r\n| WristTwist    | onWristTwist                                                                                                                                                   | [Link](https://github.com/nisrulz/sensey/wiki/Usage#wristtwist)    |\r\n| Movement      | onMovement\u003cbr/\u003eonStationary                                                                                                                                    | [Link](https://github.com/nisrulz/sensey/wiki/Usage#movement)      |\r\n| SoundLevel    | onSoundDetected                                                                                                                                                | [Link](https://github.com/nisrulz/sensey/wiki/Usage#soundlevel)    |\r\n| RotationAngle | onRotation                                                                                                                                                     | [Link](https://github.com/nisrulz/sensey/wiki/Usage#rotationangle) |\r\n| TiltDirection | onTiltInAxisX\u003cbr/\u003eonTiltInAxisY\u003cbr/\u003eonTiltInAxisZ                                                                                                              | [Link](https://github.com/nisrulz/sensey/wiki/Usage#tiltdirection) |\r\n| Scoop         | onScooped                                                                                                                                                      | [Link](https://github.com/nisrulz/sensey/wiki/Usage#scoop)         |\r\n| PickupDevice  | onDevicePickedUp\u003cbr/\u003eonDevicePutDown                                                                                                                           | [Link](https://github.com/nisrulz/sensey/wiki/Usage#pickupdevice)  |\r\n| Steps         | stepInformation                                                                                                                                                | [Link](https://github.com/nisrulz/sensey/wiki/Usage#steps)         |\r\n| TouchType     | onDoubleTap\u003cbr/\u003eonScroll(direction)\u003cbr/\u003eonSingleTap\u003cbr/\u003eonSwipeLeft\u003cbr/\u003eonSwipeRight\u003cbr/\u003eonLongPress\u003cbr/\u003eonTwoFingerSingleTap\u003cbr/\u003eonThreeFingerSingleTap | [Link](https://github.com/nisrulz/sensey/wiki/Usage#touchtype)     |\r\n\r\n# Changelog\r\n\r\nStarting with `1.0.1`, Changes exist in the [releases tab](https://github.com/nisrulz/sensey/releases).\r\n\r\n# Including in your project\r\n\r\nSensey is available in the Jcenter, so getting it as simple as adding it as a dependency\r\n\r\n```gradle\r\nimplementation 'com.github.nisrulz:sensey:{latest version}'\r\n```\r\n\r\nwhere `{latest version}` corresponds to published version in [ ![Download](https://api.bintray.com/packages/nisrulz/maven/com.github.nisrulz%3Asensey/images/download.svg) ](https://bintray.com/nisrulz/maven/com.github.nisrulz%3Asensey/_latestVersion)\r\n\r\n# Simple example\r\n\r\n- To initialize Sensey under your `onCreate()` in the activity/service, call\r\n\r\n```java\r\nSensey.getInstance().init(context);\r\n```\r\n\r\n- To stop Sensey, under your `onDestroy()` in the activity/service, call\r\n\r\n```java\r\n // *** IMPORTANT ***\r\n // Stop Sensey and release the context held by it\r\n Sensey.getInstance().stop();\r\n```\r\n\r\n- Next to enable shake detection\r\n\r\n  - Create an instance of ShakeListener\r\n\r\n  ```java\r\n  ShakeDetector.ShakeListener shakeListener=new ShakeDetector.ShakeListener() {\r\n      @Override public void onShakeDetected() {\r\n         // Shake detected, do something\r\n     }\r\n\r\n     @Override public void onShakeStopped() {\r\n         // Shake stopped, do something\r\n     }\r\n  };\r\n  ```\r\n\r\n  - Now to start listening for Shake gesture, pass the instance `shakeListener` to `startShakeDetection()` function\r\n\r\n  ```java\r\n  Sensey.getInstance().startShakeDetection(shakeListener);\r\n  ```\r\n\r\n  If you want to modify the `threshold` and `time` before declaring that shake gesture is stopped, use\r\n\r\n  ```java\r\n  Sensey.getInstance().startShakeDetection(threshold,timeBeforeDeclaringShakeStopped,shakeListener);\r\n  ```\r\n\r\n  - To stop listening for Shake gesture, pass the instance `shakeListener` to `stopShakeDetection()` function\r\n\r\n  ```java\r\n  Sensey.getInstance().stopShakeDetection(shakeListener);\r\n  ```\r\n\r\n### :page_with_curl: For more info , check the **[Wiki Docs](https://github.com/nisrulz/sensey/wiki/Usage)**\r\n\r\n# Pull Requests\r\n\r\nI 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:\r\n\r\n1. 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](https://github.com/nisrulz/AndroidCodeStyle/tree/nishant-config), so please use the same when editing this project.\r\n2. If its a feature, bugfix, or anything please only change code to what you specify.\r\n3. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)\r\n4. Pull requests _must_ be made against `develop` branch. Any other branch (unless specified by the maintainers) will get rejected.\r\n5. Check for existing [issues](https://github.com/nisrulz/sensey/issues) first, before filing an issue.\r\n6. Have fun!\r\n\r\n## References of Sensey\r\n\r\nSensey is being used in production apps as well as research \u0026 development for thesis at universities.\r\n\r\n[Click here for the full list of references](references/Readme.md)\r\n\r\n## License\r\n\r\nLicensed under the Apache License, Version 2.0, [click here for the full license](/LICENSE.txt).\r\n\r\n# Author \u0026 Contributors\r\n\r\nThis project was created by [Nishant Srivastava](https://github.com/nisrulz/nisrulz.github.io#nishant-srivastava) but hopefully developed and maintained by many others. See the [the list of contributors here](https://github.com/nisrulz/sensey/graphs/contributors).\r\n\r\n# Ways You Can Help/Support this project\r\n\r\n- **Star** this repository and tell all your friends about it.\r\n- **Watch** for new releases to get an update if something happens.\r\n- [**Open an Issue**](https://github.com/nisrulz/sensey/issues/new/choose) if you catch any error in copy text or within the project itself.\r\n- **Open a Pull Request** to add more reference links of where Sensey is being used or fixes against [existing issues](https://github.com/nisrulz/sensey/issues).\r\n\r\n- If you can spare a few 💵:\r\n\r\n  - [Buy me a coffee :coffee:](https://www.buymeacoffee.com/nisrulz) (one-time),\r\n  - or [Sponsor me on GitHub](https://github.com/sponsors/nisrulz) (recurring monthly).\r\n\r\n- Tell me you like this project or how it helped you out!\r\n\r\n  - [Comment in the project's guestbook](https://github.com/nisrulz/sensey/issues/54) :blush:,\r\n  - Reach out on [Twitter](https://twitter.com/nisrulz),\r\n  - or [send a nice email my way](mailto:nisrulz@gmail.com)!\r\n\r\nThanks for your interest in this software :heart:\r\n\r\n\u003cimg src=\"http://forthebadge.com/images/badges/built-for-android.svg\" /\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnisrulz%2Fsensey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnisrulz%2Fsensey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnisrulz%2Fsensey/lists"}