Getting Started
Last updated
Last updated
This documentation contains guidance for developing mobile applications with the EMOTIV Cortex library.
The Cortex library uses the same JSON API as the Cortex service on desktop. This JSON API is documented in the .
On desktop, you send JSON messages to the Cortex service via a WebSocket connection. In the Cortex library, you also send JSON messages, but you use a native API (in or ) instead of a WebSocket connection. The Cortex library also provides some additional JSON methods that are not available when you connect to the Cortex API using a WebSocket.
So this documentation is divided in 3 parts:
the for iOS developers
the for Android developers
the for all developers
If you are not familiar with the Cortex JSON API, then please read the Cortex API documentation:
The EMOTIV Cortex library is available on iOS and Android.
On iOS, the library is provided as a XCFramework. It contains the binaries for iOS devices and the iOS simulator. It targets iOS 12. The library is currently in Beta.
The file Info.plist
of your iOS application must contain the keys NSBluetoothAlwaysUsageDescription
and NSBluetoothPeripheralUsageDescription
.
Example:
On Android, the library is build for armeabi-v7a and arm64-v8a. It supports Android 7.0 (API level 24) or above. The library is currently in Beta.
In order to use the Cortex library, the manifest file of your Android application must include these permissions:
Your Android application must ask the user to grant these permissions:
Manifest.permission.ACCESS_COARSE_LOCATION
Manifest.permission.WRITE_EXTERNAL_STORAGE
Cortex library on iOS has a method to identify a iOS device, and store this information in the iOS keychain. This is to count how many iOS devices are using the same license.
If you use different vendor id in your iOS applications, then, when an end-user installs your applications on a single iOS device, the EMOTIV license system will believe that the license is used on 2 devices instead of 1. This will be a problem for the user, because they will be able to use their license on less devices that what they actually paid for.
For example, suppose you develop 2 iOS applications, and they use the bundle identifiers com.company.app1 and com.company123.app2. They also use same license "abcd". A user installs both of them on the same iOS device. The expectation is that only one iOS device is registered with the license "abcd". But actually 2 devices have been registered.
The Cortex library supports the following headsets:
Model
Firmware
Connection
All
BTLE 4.0
All
BTLE 4.0
Bluetooth® 5.0 will be available with upcoming software and firmware updates
All
BTLE 4.0
All
BTLE 4.0
All
BTLE 4.0
The Cortex library can connect to EMOTIV headsets via Bluetooth only. The EMOTIV USB dongle is not supported.
To include the Cortex library XCFramework to your iOS application, please follow this from Apple.
To avoid this issue, EMOTIV recommends that you use the same for all your Cortex applications.
To help you getting started with your application, EMOTIV provides basic example applications for both iOS and Android. There are open source and hosted by Github at