{"id":18784467,"url":"https://github.com/pwittchen/neurosky-android-sdk","last_synced_at":"2025-07-18T10:33:08.283Z","repository":{"id":56507192,"uuid":"96048740","full_name":"pwittchen/neurosky-android-sdk","owner":"pwittchen","description":"Android SDK for the NeuroSky MindWave Mobile Brainwave Sensing Headset","archived":false,"fork":false,"pushed_at":"2020-11-03T12:55:37.000Z","size":588,"stargazers_count":55,"open_issues_count":22,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-30T12:17:32.766Z","etag":null,"topics":["android","bci","brain","brain-computer-interface","eeg","mindwave","neurosky","rxandroid","rxjava","rxkotlin","sdk","thinkgear"],"latest_commit_sha":null,"homepage":"https://pwittchen.github.io/neurosky-android-sdk/docs","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/pwittchen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["pwittchen"],"custom":["https://paypal.me/pwittchen"]}},"created_at":"2017-07-02T21:01:16.000Z","updated_at":"2025-05-03T10:31:03.000Z","dependencies_parsed_at":"2022-08-15T20:00:56.972Z","dependency_job_id":null,"html_url":"https://github.com/pwittchen/neurosky-android-sdk","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pwittchen/neurosky-android-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2Fneurosky-android-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2Fneurosky-android-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2Fneurosky-android-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2Fneurosky-android-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pwittchen","download_url":"https://codeload.github.com/pwittchen/neurosky-android-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pwittchen%2Fneurosky-android-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265742624,"owners_count":23820872,"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","bci","brain","brain-computer-interface","eeg","mindwave","neurosky","rxandroid","rxjava","rxkotlin","sdk","thinkgear"],"created_at":"2024-11-07T20:43:07.299Z","updated_at":"2025-07-18T10:33:08.257Z","avatar_url":"https://github.com/pwittchen.png","language":"Java","funding_links":["https://github.com/sponsors/pwittchen","https://paypal.me/pwittchen"],"categories":["Software"],"sub_categories":["Mobile Apps"],"readme":"NeuroSky Android SDK\n====================\n\nAndroid SDK for the NeuroSky MindWave Mobile Brainwave Sensing Headset\n\n[![Build Status](https://img.shields.io/travis/pwittchen/neurosky-android-sdk.svg?branch=master\u0026style=flat-square)](https://travis-ci.org/pwittchen/neurosky-android-sdk) [![codecov](https://img.shields.io/codecov/c/github/pwittchen/neurosky-android-sdk/master.svg?style=flat-square\u0026label=coverage)](https://codecov.io/gh/pwittchen/neurosky-android-sdk) ![Maven Central](https://img.shields.io/maven-central/v/com.github.pwittchen/neurosky-android-sdk.svg?style=flat-square)\n\nThis SDK allows you to write mobile Android apps interacting with the brain via [NeuroSky](http://neurosky.com/) MindWave Mobile device connected to the phone or tablet via Bluetooth. You can write apps controlled by your brain or perform data acquisition and analysis of the brain signals (attention, meditation, brain waves, raw signal) and eye blinks. NeuroSky uses EEG technology for gathering brain data and EMG sensor for detecting blinks. NeuroSky Android SDK uses ThinkGear library under the hood, which was developed by the NeuroSky company. \n\n**Please note**: this SDK is not a product of NeuroSky company, but it depends on its software and hardware\n\nContents\n--------\n\n- [Usage](#usage)\n  - [Java](#java)\n    - [Listener](#listener)\n    - [RxJava](#rxjava)\n  - [Kotlin](#kotlin)\n    - [Listener](#listener-1)\n    - [RxKotlin](#rxkotlin)\n- [Examples](#examples)\n- [Download](#download)\n- [Tests](#tests)\n- [Code style](#code-style)\n- [Static code analysis](#static-code-analysis)\n- [JavaDoc](#javadoc)\n- [Documentation](#documentation)\n- [Changelog](#changelog)\n- [Releasing](#releasing)\n- [Verified devices](#verified-devices)\n- [Device diagram](#device-diagram)\n- [References](#references)\n- [License](#license)\n\nUsage\n-----\n\n### Java\n\n#### Listener\n\n```java\n// initialize NeuroSky object with listener\nNeuroSky neuroSky = new NeuroSky(new ExtendedDeviceMessageListener() {\n  @Override public void onStateChange(State state) {\n    // handle state change...\n  }\n\n  @Override public void onSignalChange(Signal signal) {\n    // handle signal change...\n  }\n\n  @Override public void onBrainWavesChange(Set\u003cBrainWave\u003e brainWaves) {\n    // handle brain waves change...\n  }\n});\n\n// connect to the device\ntry {\n  neuroSky.connect();\n} catch (BluetoothNotEnabledException e) {\n  // handle exception...\n}\n\n// disconnect from the device\nneuroSky.disconnect();\n\n// start monitoring\nneuroSky.start();\n\n// stop monitoring\nneuroSky.stop();\n```\n\nYou can also create simpler listener with `DeviceMessageListener` interface and handle `android.os.Message` objects.\n\n```java\nNeuroSky neuroSky = new NeuroSky(message -\u003e {\n  // handle message...\n});\n```\n\nNevertheless, in that case, you'll have to process and handle data manually.\n\n#### RxJava\n\n```java\n// initialize object\nRxNeuroSky neuroSky = new RxNeuroSky();\n\n// stream data\nneuroSky\n  .stream()\n  .subscribeOn(Schedulers.computation())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(brainEvent -\u003e {\n    // handle state in brainEvent.state();\n    // handle signal in brainEvent.signal();\n    // handle brainwaves in brainEvent.brainWaves();\n  });\n\n// connect to the device\nneuroSky\n  .connect()\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(\n      () -\u003e /* is connecting... */,\n      throwable -\u003e { /* handle error...*/ }\n  );\n\n// start monitoring\nneuroSky\n  .start()\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(\n    () -\u003e /* started monitoring */,\n    throwable -\u003e { /* handle error...*/ }\n   );\n\n// stop monitoring\nneuroSky\n  .stop()\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(\n    () -\u003e /* stopped monitoring */,\n    throwable -\u003e { /* handle error...*/ }\n   );\n\n// disconnect from the device\nneuroSky\n  .disconnect()\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(\n    () -\u003e /* is disconnected */,\n    throwable -\u003e { /* handle error...*/ }\n  );\n\n```\n\nDefault backpressure strategy is `BUFFER`. In order to customize backpressure strategy, you can use the following method:\n\n```java\nFlowable\u003cBrainEvent\u003e stream(backpressureStrategy)\n```\n\n### Kotlin\n\n#### Listener\n\n```kotlin\n// initialize NeuroSky object with listener\nval neuroSky = NeuroSky(object : ExtendedDeviceMessageListener() {\n  override fun onStateChange(state: State) {\n    handleStateChange(state)\n  }\n\n  override fun onSignalChange(signal: Signal) {\n    handleSignalChange(signal)\n  }\n\n  override fun onBrainWavesChange(brainWaves: Set\u003cBrainWave\u003e) {\n    handleBrainWavesChange(brainWaves)\n  }\n})\n\n// connect to the device\ntry {\n  neuroSky.connect()\n} catch (e: BluetoothNotEnabledException) {\n  // handle exception...\n}\n\n// disconnect from the device\nneuroSky.disconnect()\n\n// start monitoring\nneuroSky.start()\n\n// stop monitoring\nneuroSky.stop()\n```\n\nYou can also create simpler listener with `DeviceMessageListener` interface and handle `android.os.Message` objects.\n\n```kotlin\nval neuroSky = NeuroSky(DeviceMessageListener {\n  // handle message here...\n})\n```\n\nNevertheless, in that case, you'll have to process and handle data manually.\n\n#### RxKotlin\n\n```kotlin\n//initialize object\nval neuroSky = RxNeuroSky()\n\n// stream data\nneuroSky\n  .stream()\n  .subscribeOn(Schedulers.computation())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe {\n    // handle state in it.state();\n    // handle signal in it.signal();\n    // handle brainwaves in it.brainWaves();\n  }\n\n// connect to the device\nneuroSky\n  .connect()\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(\n      { /* is connecting... */ },\n      { throwable -\u003e /* handle error */ }\n  )\n\n// start monitoring\nneuroSky\n  .start()\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(\n      { /* started monitoring */ },\n      { throwable -\u003e /* handle error */ }\n  )\n\n// stop monitoring\nneuroSky\n  .stop()\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(\n      { /* stopped monitoring */ },\n      { throwable -\u003e /* handle error */ }\n  )\n\n// disconnect from the device\nneuroSky\n  .disconnect()\n  .subscribeOn(Schedulers.io())\n  .observeOn(AndroidSchedulers.mainThread())\n  .subscribe(\n      { /* is disconnected */ },\n      { throwable -\u003e /* handle error */ }\n  )\n```\n\nDefault backpressure strategy is `BUFFER`. In order to customize backpressure strategy, you can use the following method:\n\n```java\nFlowable\u003cBrainEvent\u003e stream(backpressureStrategy)\n```\n\nExamples\n--------\n\nYou can find examples of library usage in the following directories:\n- `app-java` (example with listener)\n- `app-kotlin` (example with listener)\n- `app-rxjava`\n- `app-rxkotlin`\n\nDownload\n--------\n\nYou can depend on the library through Gradle:\n\n```groovy\ndependencies {\n  implementation 'com.github.pwittchen:neurosky-android-sdk:0.0.2'\n}\n```\n\n**Please note**: this library is released as a **fat aar** and contains all its dependencies within a single `*.aar` file. It's done this way because this library depends on ThinkGear library, which is distributed as a `ThinkGear.jar` file by the NeuroSky company. ThinkGear is also not available on the Maven Central repository. I wanted to make usage of this library as simple as possible without bothering about additional dependencies and custom configuration. Now, with this approach we can add a single dependency to our project and we're good to go.\n\nTests\n-----\n\nTests are available in `library/src/test/java/` directory and can be executed on JVM without any emulator or Android device from Android Studio or CLI with the following command:\n\n```\n./gradlew test\n```\n\nTo generate test coverage report, run the following command:\n\n```\n./gradlew test jacocoTestReport\n```\n\nCode style\n----------\n\nCode style used in the project is called `SquareAndroid` from Java Code Styles repository by Square available at: https://github.com/square/java-code-styles.\n\nStatic code analysis\n--------------------\n\nStatic code analysis runs Checkstyle, PMD and Lint. It can be executed with command:\n\n ```\n ./gradlew check\n ```\n\nJavaDoc\n-------\n\nJavaDoc is available at: http://pwittchen.github.io/neurosky-android-sdk/javadoc\n\nDocumentation\n-------------\n\nDocumentation is available at: http://pwittchen.github.io/neurosky-android-sdk/docs\n\nChangelog\n---------\n\nSee [CHANGELOG.md](https://github.com/pwittchen/neurosky-android-sdk/blob/master/CHANGELOG.md) file.\n\nReleasing\n---------\n\nSee [RELEASING.md](https://github.com/pwittchen/neurosky-android-sdk/blob/master/RELEASING.md) file.\n\nVerified devices\n----------------\n\nThis SDK was tested with the following devices:\n- NeuroSky MindWave Mobile 1\n- NeuroSky MindWave Mobile 2\n\nDevice diagram\n--------------\n\nThis is diagram of the NeuroSky MindWave Mobile 1\n\n![](https://raw.githubusercontent.com/pwittchen/neurosky-android-sdk/master/mindwave_diagram.jpg)\n\nReferences\n-----------\n- http://neurosky.com/\n- http://developer.neurosky.com/\n- https://store.neurosky.com/products/android-developer-tools-4\n- https://github.com/pwittchen/EEGReader\n- http://wittchen.io/tags/bci/\n- https://play.google.com/store/apps/details?id=com.pwittchen.eeganalyzer\n- https://github.com/topics/neurosky\n- https://slides.com/piotrwittchen/brain-computer-interface-for-mobile-devices\n- http://support.neurosky.com/kb/science/how-to-convert-raw-values-to-voltage\n- http://support.neurosky.com/kb/science/eeg-band-frequencies\n- http://developer.neurosky.com/docs/lib/exe/fetch.php?media=thinkgear_socket_protocol.pdf\n\nLicense\n-------\n\n    Copyright 2018 Piotr Wittchen\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpwittchen%2Fneurosky-android-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpwittchen%2Fneurosky-android-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpwittchen%2Fneurosky-android-sdk/lists"}