0

I'm implementing a bluetooth client to connect to a bluetooth server module.

It worked good in my LG G3(M) but I figured out that it doesn't work as expected on Samsung devices. The Galaxy S7(M), despite using the same version of android, fails to scan devices, and the connection is very unstable.

For now, I think the performance of the bluetooth code depends hardly on the maker or the hardware I'm testing on. Am I clear about this? If not, how can I make the performance uniform in all devices?

3
  • Some code, some details will surely allow us to help.
    – Arunkumar
    Aug 2, 2016 at 10:44
  • Bluetooth is highly device/chip dependent. It does not deliver the same results/performance across devices
    – Tim
    Aug 2, 2016 at 10:46
  • So, does this mean that there is hardly no device independent code to use? Aug 2, 2016 at 12:11

1 Answer 1

0

You may need to run on the UIThread using a Runnable and a Handler.

Runnable connectSamsung = new Runnable() {
    public void run() {
        mBluetoothGatt = device.connectGatt(mContext, false,
                                            mGattCallback);
    }
};

mHandler.post(connectSamsung);

See this question:

GATT callback fails to register

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.