AndroidBluetoothChatApp icon indicating copy to clipboard operation
AndroidBluetoothChatApp copied to clipboard

No devices appear

Open alex-96-eng opened this issue 2 years ago • 0 comments

I have android studios set up and two devices running the app (Pixel XL API 33 & Pixel 3a XL API 33). They are both connected to bluetooth, but I am unable to get one device to see the other. If I put a breakpoint on the code and try to list devices, the code breaks here:

https://github.com/halilozel1903/AndroidBluetoothChatApp/blob/master/app/src/main/java/com/halil/ozel/bluetoothchatapp/MainActivity.java#L120

Then if I step over it just exits, so I am assuming I don't have those permissions. Therefore, I added an else clause with this:

ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.BLUETOOTH_CONNECT}, 1);

And now the code goes into the main logical block, but there are no devices found. If I manually pair the devices via the Bluetooth settings on each phone then the device shows.

However, even then, when I try to connect, its just hangs in the state of "connecting..." :(

alex-96-eng avatar May 07 '23 04:05 alex-96-eng