title: Android listener (Read Mi band sensor data)
body: <p>I want to get real sensor(accel) data from mi band.</p>
  
  <p>I found good source code from github. But there was a problem.</p>
  
  <p><a href="https://github.com/pangliang/miband-sdk-android" rel="nofollow">https://github.com/pangliang/miband-sdk-android</a></p>
  
  <p>MainActivity.java</p>
  
  <pre><code>else if (position == menuIndex++) {
                      Log.d(TAG, "setRealtimeStep");
                      miband.setRealtimeStepsNotifyListener(new RealtimeStepsNotifyListener() {
                          @Override
                          public void onNotify(int steps) {
                              Log.d(TAG, "RealtimeStepsNotifyListener:" + steps);
                          }
                      });
  </code></pre>
  
  <p>Miband.java</p>
  
  <pre><code>public void setSensorDataNotifyListener(final NotifyListener listener) {
      Log.d(TAG, "MiBand.java-&gt;setSensorDataNotifyListener");
      this.io.setNotifyListener(Profile.UUID_SERVICE_MILI, Profile.UUID_CHAR_SENSOR_DATA, new NotifyListener() {
  
          @Override
          public void onNotify(byte[] data) {
              Log.d(TAG, "MiBand.java-&gt;setSensorDataNotifyListener-&gt;onNotify");
              Log.d(TAG, data.toString());
              listener.onNotify(data);
          }
      });
  }
  </code></pre>
  
  <p>BluetoothIO.java</p>
  
  <pre><code>public void setNotifyListener(UUID serviceUUID, UUID characteristicId, NotifyListener listener) {
      if (null == gatt) {
          Log.e(TAG, "connect to miband first");
          return;
      }
  
      BluetoothGattCharacteristic chara = gatt.getService(serviceUUID).getCharacteristic(characteristicId);
      if (chara == null) {
          Log.e(TAG, "characteristicId " + characteristicId.toString() + " not found in service " + serviceUUID.toString());
          return;
      }
  
  
      this.gatt.setCharacteristicNotification(chara, true);
      BluetoothGattDescriptor descriptor = chara.getDescriptor(Profile.UUID_DESCRIPTOR_UPDATE_NOTIFICATION);
      descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
      this.gatt.writeDescriptor(descriptor);
      this.notifyListeners.put(characteristicId, listener);
  </code></pre>
  
  <p>In this code, I don't know which line can get sensor data.
  I don't know where should I add in 'OnNotify(data)' </p>
  
  <p>If you have any clue, please help me.
  Thank you!</p>