How to read BluetoothGattCharacteristic properties like is characteristic Readable, Writable or Notifiable.
I ran into the similar problem where the sample code ONLY works when the characteristic is READ because of the operator "|". If the characteritic is of other types such as Notification or Write, the code will always set it sup as READ. The correct code should be as the following:
if((charaProp & BluetoothGattCharacteristic.PROPERTY_READ) > 0){
} else if(charaProp | BluetoothGattCharacteristic.PROPERTY_NOTIFICATION) > 0){
}
(...Continue with other cases)
Again, the google sample code is NOT correct.
David