I am Trying to read the characteristics and get its value using the following code
private byte[] val;
mBluetoothLeService.readCharacteristic(characteristic);// reads it
val=characteristic.getValue();
String s=new String(val);
My app crashes giving error "The application may be doing too much work on its main thread."
I have also tried
private String s;
mBluetoothLeService.readCharacteristic(characteristic);// reads it
s=characteristic.getStringValue(0);
but the error is same
I have debugged my code to check if its getting the value
private String s;
mBluetoothLeService.readCharacteristic(characteristic);// reads it
s=characteristic.getStringValue(0);
system.out.println(s);
which displays the correct value but on Running the code as Android App. I get the same error.