title: What is the proper method for reading a GATT characteristic in Android?
body: <p>In attempting to read the value of a Bluetooth Low-Energy GATT characteristic in the Android API 18, I came across the following dilemma: What is the proper way to retrieve the value stored in a characteristic? And at which level of the stack should this action take place?</p>
  
  <p>In conducting my own research, I stumbled upon what I understand are two possible methods:</p>
  
  <ul>
  <li><strong>BluetoothGatt</strong>.readCharacteristic(BluetoothGattCharacteristic characteristic)</li>
  <li><p><strong>BluetoothGattCharacteristic</strong>.getValue()</p>
  
  <pre><code>public void onClick(View v){        
      byteValue = mBTValueCharacteristic.getValue();
      if ((byteValue[0] &amp; 0x01) == 1)
          byteValue[0] = 0x00;
      else
          byteValue[0] = 0x01;
  
      mBTValueCharacteristic.setValue(byteValue);
      mBTGatt.writeCharacteristic(mBTValueCharacteristic);
  }
  </code></pre></li>
  </ul>
  
  <p>Above is the original code which led me to this issue. In it, I attempt to read the value of a characteristic, and simply toggle its state using a button.</p>