Monday, December 7, 2015

App of the rings: Neyya, Android SDK and BLE

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() {
     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());
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");
       mCurrentStatus = STATE_DISCONNECTED;
       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);


That method goes like this

    private String actOnGesture(int gesture){
        switch (gesture) {
            case Gesture.SWIPE_UP:
                return "SWIPE_UP";
            case Gesture.DOUBLE_TAP:
                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){
        String timeStamp = "/" + System.currentTimeMillis() +
        mFileName = Environment.getExternalStorageDirectory().
        mFileName += timeStamp;
        mRecorder = new MediaRecorder();

        try {
        catch (IOException e) {           

    private void stopRecorder() {
        if (mRecorder==null){
        mRecorder = null;

Do not forget to add the right permissions to the AndroidManifest.xml file before you test the app.

    android:name="android.permission.BLUETOOTH" />
    android:name="android.permission.BLUETOOTH_ADMIN" />

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.


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


  1. I’m not a programmer, so I’m sorry if what I say makes no sense to you. From your article it sounds like you’re are getting a handle on the programing side of the Neyya ring. I think there is a possibility to have the ring preform closer to what the investors had planned then what they finally came up with (a mouse ring). I don’t know if you are familiar with an android app called Tasker, but I believe with it and what you have been working on it could be done. In your example, two task could be created, one to start the recording and one to stop it. One could be triggered by “SINGLE_TAP = 5” and the other by “DOUBLE_TAP = 6”. To use the part that you have been working on, I believe it would need to be turned into an Intent for Tasker to understand it. That is the part I can’t wrap my head around, is how to create the Intents. So what I’m trying to say, is this a project you would be interested in? Thank you for your time.


    1. Hi Philip, Thank you for your response. Tasker looks interesting but actually I am pretty busy with too many things already ;)

  2. I saw the ring on Amazon, but it says it support only iOS and Mac, does it works on Android?

    1. It works fine with the Android SDK and the sample Android app.

      It communicates through BLE so I assume there should be no problem with the Android app that you can find in the Play Store.