4

As per title i am able to do read/write data successfully in below lollipop but in lollipop many times i am getting read/write fails.

this is how i am doing read/write data:

boolean isRead= getmBluetoothGatt().readCharacteristic(characteristic);

in lollipop devices i am getting isRead as false many times but it works perfectly on non lollipop os.

Does any one has faced such problem ? Answer will be greatly appreciated. Thanks.

3
  • what's the method you are using to scan for devices ??
    – Fakher
    Oct 13, 2015 at 9:41
  • Hello @brandy embedded i'm also facing same problem. can you please help me if you resolved that problem
    – Rajasekhar
    Aug 16, 2016 at 7:25
  • Finally i found the solution. when arise this issue, you need to again discover services from stack then after you able to write/read operation successfully with end device. This issue comes when we perform Read/Write operation with end device and if service is not found from stack. Nov 23, 2016 at 5:27

2 Answers 2

0

One of the reasons could be some of the API calls defined in Android Kitkat (APIlevel 19) have been deprecated in Lollipop versions(API level 22) with updated and additional features.You can go through the developer portal

https://developer.android.com/about/versions/android-5.0.html#Wireless to know more.

0

I have two bluetooth devices that have problems on android Lollipop but both works fine on Kitkat. The two devices on Lollipop has different issues. The first device does not respond to device discovery after the the bluetooth gatt is connected and so the read characteristic won't work. The second device automatically disconnects from gatt server after it is connected to gatt and so it won't respond to device discovery and read characteristic as well. I was able to solve the issue on the first device by repeating device discovery with 2 seconds delay interval. But I have no chance to fix the problem on the second bluetooth device.

I am using Nexus 9.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.