Questions tagged [bluetooth-socket]

45 questions
7
votes
4 answers

java.io.IOException: read failed, socket might closed or timeout, read ret: -1 on Android 5.0.1 Lollipop version

I am making Bluetooth socket connection to Bluetooth device and want to read bytes from the device. I have established connection correctly : try { Method m = mmDevice.getClass().getMethod("createRfcommSocket", new Class[] { int.class…
Kushal
  • 8,100
  • 9
  • 63
  • 82
7
votes
1 answer

send/receive data via Bluetooth

I'm trying to send/receive a string from an android device. I've been googling for the last 3 hours and I can't find anything that just works. the closest I got was this: fella and I get these errors: 02-19 15:44:17.680 …
6
votes
1 answer

Android BluetoothSocket connection returns zero

Our device sends data via Bluetooth , In android app we need to read this data. I am able to establish Bluetooth connection, and next I am calling a Thread to establish BluetoothSocket connection using BluetoothDevice. Here when the bytes are read…
5
votes
0 answers

Android Bluetooth Socket not giving expected acknowledgement

I'm sending a byte array to a bluetooth socket and I get a response from the bluetooth printer, but I'm not getting a correct sending acknowledgement for image data. I write the byte array to outputstream the following way: byte[] queryData = new…
4
votes
1 answer

Kotlin readBytes() never completes

I am only trying to write and read across a Bluetooth Socket but i my readBytes call is not completing. I think that this is very simple but maybe i am just using the wrong type of stream or something. As of right now my code is just sending a small…
Mox_z
  • 501
  • 7
  • 30
4
votes
0 answers

android Bluetooth printer does not print Arabic characters (UTF-8)

I have a bluetooth printer and I print english characters from my android app normally, but when I write Arabic characters its print them incorrectly. I try to encode outputstream when write to the printer but no result. this is my code …
Amalo
  • 772
  • 3
  • 13
  • 32
3
votes
0 answers

Programatically send text using bluetooth socket to another bluetooth device in android

For sending data to another Bluetooth device programmatically, I am using Bluetooth socket code.Whenever I called bluetoothSocket.connect(); It gives connection refused or connection to peer Exception. I have one more confusion that…
Divya SIngh
  • 129
  • 1
  • 11
3
votes
0 answers

TLS implementation for Bluetooth

How to implement TLS for Bluetooth application? I have to send and receive data over Bluetooth between android app and desktop application (python). Please guide if someone had done this before.
SeekeR
  • 145
  • 1
  • 7
2
votes
0 answers

Why BluetoothSocket.getMaxReceivePacketSize() and BluetoothSocket.getMaxTransmitPacketSize() return 0?

I develop two apps which communicate via Classic Bluetooth - one as a client and the other as a server. I manage to perform successful connection and I want to optimize my read and write operations using BluetoothSocket methods -…
2
votes
1 answer

Connecting bluetooth devices with React-Native App

I am using react-native-bluetooth-serial. I get this error whenever I try to connect a bluetooth device via my react native app: Error: read failed, socket might closed or timeout, read ret: -1 Unable to connect to device Here's what I'm trying to…
MadArk07
  • 43
  • 1
  • 3
  • 6
2
votes
1 answer

BluetoothSocket.connect() fails on Samsung S9 with Android 9

I am working on a native Android application that needs to be paired with a bluetooth device. Users with Samsung S9 with Android 9 are reporting that their mobiles does not pair with out bluetooth devices and after doing a long research I requested…
2
votes
0 answers

Java Android Bluetooth Socket Unresolved Symbol

I am trying to setup a Bluetooth connection between an Android device and an rPi. However I am getting an unresolved symbol error on socket in the testouput function. However, socket works just fine further down the code. I am not sure what I am…
1
vote
1 answer

How to get two Android devices to connect to the same Bluetooth device without unpairing?

I have an app that I communicate with a Bluetooth device via SPP, and I made a discovery that when I try to connect to the same Bluetooth device using another Android device, the other Android device cannot connect to the Bluetooth device even when…
Pink Jazz
  • 784
  • 4
  • 13
  • 34
1
vote
0 answers

Qt: RFCOMM BluetoothSocket Connection Problems after switching Pages in QML

I'm developing an cross plattform Application in Qt Creator, which has the exercise to control a device via Classic Bluetooth. I have a communication protocol. FIRST: I can connect to device and write Data to it with BluetoothSocket. If I put the…
1
vote
0 answers

Socket Client - how to

I am in an Android project which uses Bluetooth sockets. The app is the client socket. But the app crashes when working. Can anyone help me in solving the issue. here is the code public class READ extends AppCompatActivity { private static…
1
2 3