code: private boolean enableNotifyForChar(BluetoothGattCharacteristic characteristic) {
  
          boolean success = true;
  
          // Enable notifications/indications for this characteristic
          boolean successEnable = mGattClient.setCharacteristicNotification(characteristic, true);
          if (successEnable) {
              Log.i(TAG, "Enabled notify for characteristic: " + characteristic.getUuid());
          } else {
              success = false;
              Log.e(TAG, "Enable notify failed for characteristic: " + characteristic.getUuid());
          }
  
          BluetoothGattDescriptor descriptor = characteristic.getDescriptor(Constants.UUID_CLIENT_CHAR_CONFIG);
          descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
          boolean successDescriptor = mGattClient.writeDescriptor(descriptor);
  
          if (successDescriptor) {
              Log.i(TAG, "Successfully wrote notification descriptor: " + descriptor.getUuid());
          } else {
              success = false;
              Log.e(TAG, "Failed to write notification descriptor: " + descriptor.getUuid());
          }
  
          return success;
      }
docs: Enable notifications for a given characteristic.
  
  See <a href="https://developer.android.com/guide/topics/connectivity/bluetooth-le.html#notification">
  the Android docs
  </a>
  on this subject.
  
  @param characteristic    The characteristic to enable notifications for
  @return                  true if notifications were enabled successfully