An android app to view and record EEG data sent from the Muse device. BREC allows you to enter information about recordings and subjects and save everything in a .csv file in the smartphone.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
- Download the LibMuse SDK from Muse's developer website. We've already taken care of integrating the sdk library into the app, so just make sure you end place libmuse_android.so in
<clonedRepoName>/Brec_Project/BREC/android/app/src/main/jniLib/armeabi-v7a/
and libmuse_android.jar in<clonedRepoName/Brec_Project/BREC/android/app/libs/
- run
sudo yarn install
in the BREC folder
- Connect an Android device with USB debug mode enabled. Because the LibMuse library depends on an ARM architecture, Brec will not build in an emulator
- Run
sudo react-native start
to start React packager - In new terminal, run
adb reverse tcp:8081 tcp:8081
to ensure debug server is connected to your smartphone and thensudo react-native run-android
to install Brec
https://facebook.github.io/react-native/docs/signed-apk-android.html
You can generate a private signing key using keytool
.
$ keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
This command prompts you for passwords for the keystore and key, and to provide the Distinguished Name fields for your key. It then generates the keystore as a file called my-release-key.keystore
.
Place the my-release-key.keystore
file under the android/app
directory in your project folder.
Edit the file ~/.gradle/gradle.properties
or android/gradle.properties
and add the following (replace ***** with the correct keystore password, alias and key password):
...
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=*****
MYAPP_RELEASE_KEY_PASSWORD=*****
Edit the file android/app/build.gradle
in your project folder and add the signing config,
...
android {
...
defaultConfig { ... }
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
}
...
Simply run the following in a terminal:
$ cd android
$ ./gradlew assembleRelease
The generated APK can be found under android/app/build/outputs/apk/app-release.apk
, and is ready to be distributed.
Thanks to NeuroTechX for their public project on github. -> EEG101.
This project is licensed under the MIT License - see the LICENSE.md file for details