H howard bassen Member Licensed User Longtime User Jan 2, 2018 #1 I am running the example for Bluetooth connectivity between two android devices: https://www.b4x.com/android/forum/threads/android-bluetooth-bluetoothadmin-tutorial.14768 First I compiled program on my primary phone (ZTE Z981) and communicated with my PC (via its Bluetooth) . I can communicate both ways with a PC terminal emulator. When I try to connect my primary phone to a second (PAIRED) android device rather than the PC I get I see the GUI on the device but get the following errors when I try to send or receive: Logger connected to: ZTE Z981 --------- beginning of main Nexus 7:08:60:6E:9D:87:70 :17:8D:84:76:1D:02 :08:66:98:B7:7B9 :08:66:98:B7:7B9 :08:66:98:B7:7B9 connected: false java.io.IOException: read failed, socket might closed or timeout, read ret: -1 ** Activity (main) Pause, UserClosed = false ** Can anyone suggest a fix
I am running the example for Bluetooth connectivity between two android devices: https://www.b4x.com/android/forum/threads/android-bluetooth-bluetoothadmin-tutorial.14768 First I compiled program on my primary phone (ZTE Z981) and communicated with my PC (via its Bluetooth) . I can communicate both ways with a PC terminal emulator. When I try to connect my primary phone to a second (PAIRED) android device rather than the PC I get I see the GUI on the device but get the following errors when I try to send or receive: Logger connected to: ZTE Z981 --------- beginning of main Nexus 7:08:60:6E:9D:87:70 :17:8D:84:76:1D:02 :08:66:98:B7:7B9 :08:66:98:B7:7B9 :08:66:98:B7:7B9 connected: false java.io.IOException: read failed, socket might closed or timeout, read ret: -1 ** Activity (main) Pause, UserClosed = false ** Can anyone suggest a fix
Erel B4X founder Staff member Licensed User Longtime User Jan 2, 2018 #2 Is the other device listening for connections? Upvote 0
H howard bassen Member Licensed User Longtime User Jan 3, 2018 #3 Erel said: Is the other device listening for connections? Click to expand... When I use a commercial BT terminal app on my phone it works well with my PC (running a terminal emulator). For the B4A app I can connect to my PC with the B4A example with difficulty. However the B4A app looses a connection when I try to send characters to the PC. Upvote 0
Erel said: Is the other device listening for connections? Click to expand... When I use a commercial BT terminal app on my phone it works well with my PC (running a terminal emulator). For the B4A app I can connect to my PC with the B4A example with difficulty. However the B4A app looses a connection when I try to send characters to the PC.
Erel B4X founder Staff member Licensed User Longtime User Jan 3, 2018 #4 Make sure that AsyncStreams is not initialized in prefix mode. Upvote 0
H howard bassen Member Licensed User Longtime User Jan 4, 2018 #5 Erel said: Make sure that AsyncStreams is not initialized in prefix mode. Click to expand... i see async streams only once in the code. "Dim AStream As AsyncStreamsocess_Globals" Please explain prefix mode. How would I initialize AsyncStreams? Upvote 0
Erel said: Make sure that AsyncStreams is not initialized in prefix mode. Click to expand... i see async streams only once in the code. "Dim AStream As AsyncStreamsocess_Globals" Please explain prefix mode. How would I initialize AsyncStreams?
Erel B4X founder Staff member Licensed User Longtime User Jan 4, 2018 #6 howard bassen said: Please explain prefix mode Click to expand... AsyncStreams Tutorial Upvote 0
H howard bassen Member Licensed User Longtime User Jan 4, 2018 #7 Unfortunately I do not see how I can incorporate the various pieces of code into the B4A Bluetooth example to fix my problem. Which pieces of code from the Asysnc Streams need to be added to the Bluetooth example, and where? Upvote 0
Unfortunately I do not see how I can incorporate the various pieces of code into the B4A Bluetooth example to fix my problem. Which pieces of code from the Asysnc Streams need to be added to the Bluetooth example, and where?
Erel B4X founder Staff member Licensed User Longtime User Jan 5, 2018 #8 Search the code for InitializePrefix and change that line. Upvote 0
H howard bassen Member Licensed User Longtime User Jan 6, 2018 #9 sorry but the example program has neither AsyncStreams, Astreams, or InitializePrefix. Should I add these subs from another example? if so, which and how? Upvote 0
sorry but the example program has neither AsyncStreams, Astreams, or InitializePrefix. Should I add these subs from another example? if so, which and how?
H howard bassen Member Licensed User Longtime User Jan 7, 2018 #11 thanks. sorry I was not more careful Upvote 0