Android Question Pairing problem with Android 9

doncx

Active Member
Licensed User
Longtime User
My users are reporting a problem pairing Bluetooth devices to Samsung Tab A tablets running Android 9. They can't pair.

I've easily duplicated the problem. The device to which they are pairing shows up multiple times. When one of the instances is tapped the pairing fails immediately.

Please find three images attached, where I've attempted pairing my phone to a Samsung Tab A tablet with Android 9.

Other tablets running other versions of Android are pairing just fine.

Image 1: Bluetooth "Chat" example app.
Image 2: Pairing via settings, connections, Bluetooth
Image 3: Brand new "Chat" app just released on B4A v9.9

These images should exhibit the problem. Pairing with the OS works. Pairing with B4A does not.

What do you suggest?

Thanks,

- Don
 

Attachments

  • Image3.jpg
    Image3.jpg
    288.2 KB · Views: 177
  • Image2.jpg
    Image2.jpg
    97.4 KB · Views: 172
  • Image1.jpg
    Image1.jpg
    92.5 KB · Views: 167

doncx

Active Member
Licensed User
Longtime User
It's definitely listening. Pairing through Android settings is a snap. I wonder if one of the instances is the right one and all the others don't work.

My most recent attempt pairing to my phone listed it 26 times!

I tried to setup HCI logging but it looks like I may need an SD card for it to work. Is that the logging you're referring to?
 
Upvote 0

doncx

Active Member
Licensed User
Longtime User
Here's the log from the new chat app. The IOException line appears when I tapped an instance to pair.

cfrf.ocean.temps is my app that's having problems. I'm not sure why it's appearing in the log.


*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
:55:E6:A1:98:56:46
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
Galaxy A10e:88:A3:03:0E:A0:75
java.io.IOException: read failed, socket might closed or timeout, read ret: -1
** Service (s2) Create **
** Service (s2) Start **
(Intent) Intent { act=android.bluetooth.device.action.ACL_CONNECTED flg=0x5000010 cmp=cfrf.ocean.temps/.s2$s2_BR (has extras) }
Bundle[{com.samsung.bluetooth.device.extra.LINKTYPE=1, android.bluetooth.device.extra.DEVICE=88:A3:03:0E:A0:75, com.samsung.bluetooth.device.extra.DISCONNECTION_REASON=0}]
** Service (s2) Start **
(Intent) Intent { act=android.bluetooth.device.action.ACL_DISCONNECTED flg=0x5000010 cmp=cfrf.ocean.temps/.s2$s2_BR (has extras) }
Bundle[{com.samsung.bluetooth.device.extra.LINKTYPE=1, android.bluetooth.device.extra.DEVICE=88:A3:03:0E:A0:75, com.samsung.bluetooth.device.extra.DISCONNECTION_REASON=19}]
** Activity (main) Pause event (activity is not paused). **
** Service (starter) Destroy (ignored)**
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The IOException line appears when I tapped an instance to pair.
That's not correct. When you are clicking on an item from the list it tries to connect to the target device. It will fail if the other device is not listening to incoming connections. Click on the Make Discoverable button on the other device.

There is no s2 service in the example: https://www.b4x.com/android/forum/threads/b4xpages-bluetooth-chat-example.119014/#content
I'm not sure that I understand what you are doing.

Run the example as-is on both devices.
 
Upvote 0

doncx

Active Member
Licensed User
Longtime User
Erel, my apologies. In an attempt to exhibit the problem in familiar territory, I've perhaps misrepresented it and wasted your time.

I'll go back to square one and start a new thread when I can document it clearly.
 
Upvote 0
Top