My great friend Wim Wepster gave me this interesting Neyya ring. Fortunately it did not come with a proposal. Instead it was a great opportunity to explore Bluetooth and alternative wearables, such as this ring.
Neyya is a ring that can send gestures such as taps and swipes to a mobile or another device that is supporting BLE. You can use it for presentations or games, although you can just use your mouse, watch or phone for that as well. So I wondered how it works and what could be an interesting use case for it.
Neyya comes with an iOS and Android app but also with an Android SDK. I was having some troubles with it as it was not able to detect my Neyya ring at all. For the time being (as there must be a more elegant solution for it) I have fixed this by modifying the NeyyaBaseService class within the NeyyaAndroidSDK project.
I removed the check to determine whether the Bluetooth device is a Neyya ring or not from the onLeScan method.
private BluetoothAdapter.LeScanCallback mLeScanCallback =
new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(final BluetoothDevice device, int rssi,
byte[] scanRecord) {
String deviceAddress =
device.getAddress().substring(0, 13);
// if (neyyaMacSeries.equals(deviceAddress)) {
NeyyaDevice neyyaDevice = new NeyyaDevice(
device.getName(), device.getAddress());
if (!mNeyyaDevices.contains(neyyaDevice)) {
logd("Device found - " + device.getAddress()+
" Name - " + device.getName());
mNeyyaDevices.add(neyyaDevice);
broadcastDevices();
}
//}
}
};
I did the same thing for the
isNeyyaDevice method, like this.
public boolean isNeyyaDevice(NeyyaDevice device) {
String deviceAddress =
device.getAddress().substring(0, 13);
/* if (!neyyaMacSeries.equals(deviceAddress)) {
logd("Not a neyya device");
broadcastError(ERROR_NOT_NEYYA);
mCurrentStatus = STATE_DISCONNECTED;
broadcastState();
return false;
}
*/
return true;
}
Okay, I have to be more careful which Bluetooth device I pick from the list of available devices but at least I am able to continue my journey. Let's connect to the device.
Great! but what is it that we are trying to solve here?
The supported gestures are taps, double and triple taps, swipe left, right, up and down. Now, what problem could this ring solve other than the things that come with the Neyya app already, such as capturing a picture, turning the volume of a device up and down and moving to the next or previous song?
One of the problems that the Neyya ring could help me with is something that most people will recognize. Your best ideas come up when you are not able to write them down immediately, for example while taking a shower or driving a car. In such cases it would be great to just rub your ring to create an audio note. That is easy to implement.
To create a prototype I have modified the ConnectActivity class a little. First in the onReceive method of the BroadCastReceiver implementation I do call a new method actOnGesture
...
else if (MyService.BROADCAST_GESTURE.equals(action)) {
int gesture = intent.getIntExtra(MyService.DATA_GESTURE, 0);
showData(Gesture.parseGesture(gesture));
actOnGesture(gesture);
...
That method goes like this
private String actOnGesture(int gesture){
Gesture.parseGesture(gesture);
switch (gesture) {
case Gesture.SWIPE_UP:
stopRecorder();
return "SWIPE_UP";
case Gesture.DOUBLE_TAP:
startRecorder();
return "DOUBLE_TAP";
}
return "";
}
To start recording we will create a MediaRecorder instance and create an output file for it in the m4a format. in the stopRecorder method we will stop the recording.
private static String mFileName = null;
private MediaRecorder mRecorder = null;
private void startRecorder() {
if (mRecorder!=null){
return;
}
String timeStamp = "/" + System.currentTimeMillis() +
".m4a";
mFileName = Environment.getExternalStorageDirectory().
getAbsolutePath();
mFileName += timeStamp;
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(
MediaRecorder.OutputFormat.MPEG_4);
mRecorder.setOutputFile(mFileName);
mRecorder.setAudioEncoder(.
MediaRecorder.AudioEncoder.AAC);
mRecorder.setAudioSamplingRate(16000);
mRecorder.setAudioChannels(1);
mRecorder.setAudioEncodingBitRate(16);
try {
mRecorder.prepare();
}
catch (IOException e) {
}
mRecorder.start();
}
private void stopRecorder() {
if (mRecorder==null){
return;
}
mRecorder.stop();
mRecorder.release();
mRecorder = null;
}
Do not forget to add the right permissions to the AndroidManifest.xml file before you test the app.
<uses-permission
android:name="android.permission.BLUETOOTH" />
<uses-permission
android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission
android:name="android.permission.RECORD_AUDIO"/>
As soon as the app is running and the ring is connected, double tap on it to start recording and swipe up to stop the recording. You can use an app, such as the Astro app, to locate and play the audio file that you have recorded.
Conclusion
Later I will release the code of this POC on GitHub. I need to work out the concept a little bit more. Anyway, I am not fully convinced yet whether the Neyya ring is a useful wearable device or not, but by examing the code I have learned something about Android and Bluetooth and I do have a memo recorder that I can use just anywhere now.
Do not forget to take your phone with you as well, wherever you go. Wait for my first shower-voice-memos to arrive ;) Of course you can use the ring plus app as a spy tool if you want or find other purposes for it. My precious...
Further reading