title: Android BLE read Gatt Characteristic
body: <p>I am trying to read some Bluetooth Characteristics in my APP.
  Now i have a Problem with what to do after the characteristic changed from my Gatt Server. At first i've tried to use a thread to retrigger the read for the characteristic again and again like this:</p>
  
  <pre><code>new Thread(new Runnable() {
      @Override
      public void run() {
          int[] newData = new int[30];
          while(true){
              try{
                  for(int i=0;i&lt;newData.length;i++){
                      newData[i] = 0;
                  }
                  BluetoothGatt tmpGatt = refExtDataClass.getRefBluetoothGatt();
                  tmpGatt.readCharacteristic(characteristic);
  
                  byte[] value = characteristic.getValue();
  
                  for(int i=0;i&lt;newData.length;i++){
                      newData[i] = value[i];
                  }
                  refExtDataClass.setNmData(newData);
              }catch(Exception e){
                  break;
              }
          }
      }
  }).start();
  </code></pre>
  
  <p>But the Problem is that it's seems like the data is corrupt at one point (like i've always writing the same data into the characteristic from my MCU side).</p>
  
  <p>Is it allowed to read BLE data like this? Is there any suggested way to read BLE data all the time? Or update it on my App side?</p>
  
  <p>If you Need any additional code, please let me know.</p>