Skip to content

No devices appear Β #1

@alex-96-eng

Description

@alex-96-eng

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..." :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions